/* assets/rca-style.css - V4.5.4 (Responsive Fixed + Button Override) */
:root {
  --rca-primary: #2c3e50;
  --rca-radius: 8px;
}

#rca-wrap {
    display: flex; 
    flex-wrap: wrap; 
    gap: 30px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--rca-primary);
    max-width: 1100px;
    margin: 0 auto;
    width: 100%; /* Fix width */
    box-sizing: border-box;
}

/* --- CALENDRIER --- */
.rca-calendar-card {
    flex: 1 1 400px; /* Base width */
    max-width: 100%; /* Responsive fix */
    background: #fff; padding: 25px;
    border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    box-sizing: border-box;
}

.rca-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rca-header h3 { margin: 0; font-size: 1.2rem; text-transform: capitalize; }
.rca-nav-btn {
    background: #fff; border: 1px solid #ddd; padding: 5px 12px;
    border-radius: 6px; cursor: pointer; font-weight: bold; color: var(--rca-primary);
}
.rca-nav-btn:hover { background: #f9f9f9; }

#rca-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.rca-day-name { text-align: center; font-size: 0.85rem; font-weight: 700; color: #7f8c8d; padding-bottom: 10px; text-transform: uppercase; }

.rca-day {
    aspect-ratio: 1/1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border-radius: var(--rca-radius); cursor: pointer;
    font-size: 0.95rem; position: relative; 
    font-weight: 600;
}

/* COULEURS TEXTE FORCEES */
.rca-day.available { background: var(--rca-bg-avail); color: #000 !important; }
.rca-day.available:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.rca-day.reserved { background: var(--rca-bg-reserved); color: #fff !important; cursor: help; opacity: 1; }
.rca-day.reserved .date-num { text-decoration: line-through; opacity: 0.8; }
.rca-day.selected { background: var(--rca-accent); color: #000 !important; box-shadow: 0 0 0 2px #fff inset; }
.rca-day.empty { background: transparent; cursor: default; }

.rca-legend { margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; display: flex; gap: 15px; justify-content: center; font-size: 0.9rem; flex-wrap: wrap;}
.rca-legend-item { display: flex; align-items: center; gap: 6px; }
.box { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1); }
.box.available { background: var(--rca-bg-avail); }
.box.reserved { background: var(--rca-bg-reserved); }
.box.selected { background: var(--rca-accent); }

/* --- FORMULAIRE --- */
.rca-form-card {
    flex: 1 1 350px; 
    max-width: 100%; /* Responsive fix */
    background: #fff; padding: 25px;
    border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee; height: fit-content;
    box-sizing: border-box;
}
.rca-form-card h3 { margin-top: 0; margin-bottom: 20px; border-bottom: 2px solid var(--rca-accent); display: inline-block; padding-bottom: 5px; }

.rca-form-card label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }
.rca-form-card input[type="text"], .rca-form-card input[type="email"], .rca-form-card input[type="date"] {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd;
    border-radius: 6px; font-size: 1rem; margin-bottom: 15px; box-sizing: border-box;
}

.rca-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* BOUTON DYNAMIQUE - FORCE OVERRIDE */
button.rca-submit, 
input[type="submit"].rca-submit {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    margin-top: 15px !important;
    transition: all 0.3s ease !important;
    box-shadow: none !important;
    text-transform: none !important;
    
    /* DEFAULT STATE: DISABLED (GRAY) */
    background-color: #e0e0e0 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ACTIVE STATE: ORANGE */
button.rca-submit.is-active,
input[type="submit"].rca-submit.is-active {
    background-color: #DD4F13 !important;
    color: #fff !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}
button.rca-submit.is-active:hover { opacity: 0.9 !important; }

/* TOOLTIP */
.rca-day[data-tooltip]:hover::after {
    content: attr(data-tooltip); position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%);
    background-color: #333; color: #fff; padding: 6px 10px; border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 100; pointer-events: none;
}

/* MOBILE FIX */
@media(max-width: 768px) {
    #rca-wrap { flex-direction: column; padding: 10px; }
    .rca-calendar-card, .rca-form-card { flex: 1 1 auto; width: 100%; }
    .rca-dates { grid-template-columns: 1fr; gap: 10px; }
    #rca-calendar { gap: 4px; }
    .rca-day { font-size: 0.8rem; border-radius: 4px; }
}