/* =============================================================
   CONCOURS WIZARD — styles partagés entre ESC, EPA, IFTICSUP, YSEM
   ============================================================= */

/* ── RESET & BASE ── */
.iti { width: 100%; }

input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    text-align: left !important;
    border: 1px solid #cbd5e1 !important;
}

/* ── FORM-CONTROL (Bootstrap class → Tailwind style) ── */
.form-control {
    display: block !important;
    width: 100% !important;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 0.625rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s !important;
    text-align: left !important;
    box-sizing: border-box !important;
}
.form-control:focus {
    outline: none !important;
    border-color: #1e40af !important;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.12) !important;
    background-color: #fafcff !important;
}
.form-control:hover:not(:focus):not(:disabled) {
    border-color: #94a3b8 !important;
}
.form-control::placeholder {
    color: #94a3b8 !important;
    font-size: 0.82rem !important;
}
.form-control:disabled {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    border-color: #e2e8f0 !important;
}
select.form-control {
    cursor: pointer !important;
    padding-right: 2.25rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.6rem center !important;
    background-size: 1.2em !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* ── intl-tel-input v23 variables ── */
:root {
    --iti-hover-color: #eff6ff;
    --iti-border-color: #e2e8f0;
    --iti-dropdown-bg: #ffffff;
    --iti-dialcode-color: #64748b;
    --iti-spacer-horizontal: 8px;
}
.iti { width: 100% !important; }

.iti__selected-country {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-right: none !important;
    border-radius: 0.625rem 0 0 0.625rem !important;
    padding: 0 10px !important;
    transition: background 0.15s !important;
}
.iti__selected-country:hover { background: #eff6ff !important; }

/* padding-left géré inline par la lib — ne pas l'écraser */
.iti input.form-control,
.iti__tel-input {
    border-radius: 0 0.625rem 0.625rem 0 !important;
    padding-right:  0.875rem !important;
    padding-top:    0.6rem   !important;
    padding-bottom: 0.6rem   !important;
}

.iti--container {
    z-index: 99999 !important;
    position: fixed !important;
}
.iti--container .iti__dropdown-content {
    display: flex !important;
    flex-direction: column !important;
    max-height: 300px !important;
    min-width: 280px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18) !important;
    background: #ffffff !important;
    overflow: hidden !important;
}
.iti--container .iti__search-input {
    flex-shrink: 0 !important;
    width: 100% !important;
    border: none !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 10px 14px !important;
    font-size: 0.84rem !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    box-sizing: border-box !important;
    text-align: left !important;
    outline: none !important;
}
.iti--container .iti__search-input:focus {
    background: #eff6ff !important;
    border-bottom-color: #1e40af !important;
}
.iti--container .iti__search-input::placeholder {
    color: #94a3b8 !important;
    font-style: italic;
}
.iti--container .iti__country-list {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    background: #fff !important;
    list-style: none !important;
}
.iti--container .iti__country {
    display: flex !important;
    align-items: center !important;
    padding: 8px 14px !important;
    cursor: pointer !important;
    gap: 8px !important;
}
.iti--container .iti__country:hover,
.iti--container .iti__country.iti__highlight {
    background: #eff6ff !important;
}
.iti--container .iti__country-name {
    color: #374151 !important;
    font-size: 0.84rem !important;
}
.iti--container .iti__dial-code {
    color: #64748b !important;
    font-size: 0.78rem !important;
}

.errorlist { display: none; }

/* ── CHAMPS INVALIDES ── */
input.is-invalid, select.is-invalid, textarea.is-invalid {
    border: 1.5px solid #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
    background-color: #fff8f8 !important;
}
.photo-upload-zone.is-invalid {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
    background-color: #fff8f8 !important;
}
.field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #dc2626;
    font-size: 0.78rem;
    margin-top: 5px;
    font-weight: 500;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    padding: 4px 10px;
    border-radius: 0 5px 5px 0;
}
.form-group.has-error .field-label { color: #dc2626; }

/* ── LAYOUT DES CHAMPS ── */
.form-group { margin-bottom: 1.1rem; }
.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.field-label .req { color: #ef4444; font-size: 0.75rem; }

/* ── SECTION CARDS ── */
.form-section {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05), 0 1px 4px rgba(0,0,0,0.03);
    position: relative;
    overflow: visible;
}
.form-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #e8edf5;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── PHOTO UPLOAD ── */
.photo-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}
.photo-upload-zone:hover { border-color: #1e40af; background: #eff6ff; }
.photo-upload-zone.has-photo {
    background: #fff;
    border-style: solid;
    border-color: #93c5fd;
    height: 130px;
}
.photo-upload-zone .photo-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: none;
}
.photo-upload-zone.has-photo .photo-img { display: block; }
.photo-upload-zone.has-photo .photo-placeholder { display: none; }
.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    padding: 0.5rem;
}
.photo-placeholder svg { color: #94a3b8; }
.photo-placeholder .ph-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.photo-placeholder span { font-size: 0.72rem; color: #94a3b8; font-weight: 500; text-align: center; }
.photo-placeholder .ph-btn {
    font-size: 0.72rem;
    background: #1e40af;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 2px;
}

/* ── ATTENTION BANNER ── */
.nb-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #78350f;
    margin-bottom: 1.5rem;
}

/* ── WIZARD PROGRESS BAR ── */
.wizard-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 0.75rem;
    gap: 0;
    background: #ffffff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    padding: 1.5rem 1.25rem 1.25rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.wizard-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 160px;
}
.wizard-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 19px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
    transition: background 0.4s;
}
.wizard-progress-step.done::after {
    background: linear-gradient(90deg, #1e40af, #3b82f6);
}
.wizard-progress-step.active::after {
    background: linear-gradient(90deg, #1e40af 40%, #e2e8f0 100%);
}
.wizard-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #94a3b8;
    position: relative;
    z-index: 1;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.wizard-progress-step.active .wizard-circle {
    border-color: #1e40af;
    background: #1e40af;
    color: #fff;
    box-shadow: 0 0 0 5px rgba(30,64,175,0.13), 0 4px 12px rgba(30,64,175,0.25);
    transform: scale(1.08);
}
.wizard-progress-step.done .wizard-circle {
    border-color: #1e40af;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30,64,175,0.2);
}
.wizard-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 8px;
    text-align: center;
    line-height: 1.3;
    transition: color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wizard-progress-step.active .wizard-label { color: #1e40af; }
.wizard-progress-step.done .wizard-label { color: #3b82f6; }

/* ── STEP CONTEXT CARD ── */
.step-context-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 1.5rem;
}
.step-context-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step-context-icon svg { color: white; }
.step-context-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 1px;
}
.step-context-desc {
    font-size: 0.78rem;
    color: #3b82f6;
    font-weight: 500;
}

/* ── WIZARD STEP VISIBILITY ── */
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeSlideIn 0.3s ease; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── ERROR BANNER WIZARD ── */
.wizard-error-banner {
    display: none;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #dc2626;
    font-weight: 500;
}
.wizard-error-banner.visible { display: flex; }

/* ── NAVIGATION STICKY BAR ── */
.wizard-nav-wrapper {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin-top: 1.5rem;
}
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.96);
    border: 1px solid #e8edf5;
    border-radius: 14px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
    backdrop-filter: blur(8px);
    gap: 1rem;
}
.wizard-nav-left { display: flex; gap: 0.75rem; align-items: center; }
.wizard-nav-right { display: flex; gap: 0.75rem; align-items: center; }
.wizard-step-indicator {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* ── TABLE STYLES ── */
.table-wizard {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    overflow: hidden;
}
.table-wizard thead tr {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
}
.table-wizard th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #bfdbfe;
}
.table-wizard td {
    padding: 8px 10px;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}
.table-wizard tbody tr:last-child td { border-bottom: none; }
.table-wizard tbody tr:hover { background: #fafcff; }

/* ── ATTESTATION CHECKBOX ── */
.attestation-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 100%);
    border: 1.5px solid #86efac;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}
.attestation-box input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
    border: 2px solid #16a34a !important;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #16a34a;
    text-align: left !important;
}
.attestation-box label {
    font-size: 0.875rem;
    color: #15803d;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
}

/* ── BOUTONS ── */
.btn-prev {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.25rem;
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-prev:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}
.btn-prev:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    border: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(30,64,175,0.25);
}
.btn-next:hover {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30,64,175,0.3);
}
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1.75rem;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(22,163,74,0.3);
}
.btn-submit:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22,163,74,0.35);
}
.btn-submit.hidden, .btn-next.hidden { display: none !important; }

/* ── PARENTS SECTION ── */
.parent-card {
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e8edf5;
    padding: 1.1rem 1.25rem;
}
.parent-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── PILLS INFO ── */
.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── MODAL CONFIRM ── */
@keyframes modalIn {
    from { opacity:0; transform:translateY(20px) scale(0.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}
.recap-section { margin-bottom: 16px; }
.recap-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 6px 10px;
    background: #eff6ff;
    border-radius: 7px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.recap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.recap-item { display: flex; flex-direction: column; gap: 1px; }
.recap-label { font-size: 0.7rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.recap-value { font-size: 0.84rem; color: #1e293b; font-weight: 500; word-break: break-word; }
.recap-value.empty { color: #cbd5e1; font-style: italic; font-weight: 400; }
.recap-photo { width: 56px; height: 70px; border-radius: 8px; object-fit: cover; border: 2px solid #e2e8f0; }
.modal-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: #92400e;
}

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
