/*
 * Panneau : « Nueva Inscripción » (coordonnées, détail des frais, pago
 * recibido hoy, accès personnel), « Enviar acceso personal » et le
 * Comprobante de pago (document clair, aussi exporté en PDF).
 * Consomme les jetons --itc-* de design-system.css.
 */

/* ── Formulaire d'inscription ─────────────────────────────────────────── */

#modal-add .modal-content.enroll-modal {
    width: 580px;
    max-width: calc(100vw - 32px);
}

#modal-access .modal-content.enroll-modal-small {
    width: 460px;
    max-width: calc(100vw - 32px);
}

.enroll-title {
    margin-bottom: 6px;
}

.enroll-session {
    color: var(--itc-success);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 18px;
}

.enroll-section {
    color: var(--itc-text-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    margin: 6px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.enroll-section em,
.enroll-sublabel em {
    color: var(--itc-text-secondary);
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0;
}

.enroll-section-spaced {
    margin-top: 20px;
}

.enroll-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.enroll-grid-address {
    grid-template-columns: 1.5fr 1fr;
}

.enroll-hint,
.enroll-field-status {
    font-size: 0.72rem;
    margin-top: 6px;
    color: var(--itc-text-secondary);
}

.enroll-field-status.is-valid {
    color: #22c55e;
    font-weight: 600;
}

.enroll-field-status.is-invalid {
    color: #ff7b7b;
    font-weight: 600;
}

#modal-add .form-group input.is-invalid,
#modal-access .form-group input.is-invalid,
#modal-edit .form-group input.is-invalid {
    border-color: var(--itc-danger);
}

#modal-add .form-group select,
#modal-access .form-group input {
    width: 100%;
    padding: 10px;
    background: var(--itc-navy-950);
    border: 1px solid var(--itc-border-blue);
    color: var(--itc-text-primary);
    border-radius: var(--itc-radius-sm);
    box-sizing: border-box;
    font: inherit;
}

#modal-add .form-group select {
    /* Même taille que les <input> du panneau (13,33 px par défaut). */
    font-size: 0.8333rem;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    cursor: pointer;
}

#modal-add .form-group select:focus-visible,
#modal-access .form-group input:focus,
#modal-access .form-group input:focus-visible {
    outline: var(--itc-focus-ring);
    outline-offset: 2px;
    border-color: var(--itc-gold-500);
}

#modal-access .form-group input::placeholder {
    color: var(--itc-placeholder);
    opacity: 1;
}

.enroll-combo {
    position: relative;
}

.enroll-combo i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--itc-text-secondary);
    font-size: 0.75rem;
    pointer-events: none;
}

#modal-add .enroll-combo input {
    padding-right: 34px;
}

/* Le chevron natif des listes <datalist> ferait doublon avec le nôtre. */
#modal-add .enroll-combo input::-webkit-calendar-picker-indicator {
    opacity: 0;
}

.enroll-money {
    position: relative;
}

.enroll-money span {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--itc-gold-500);
    font-weight: 700;
    z-index: 1;
    pointer-events: none;
}

#modal-add .enroll-money input {
    padding-left: 30px;
    font-variant-numeric: tabular-nums;
}

.enroll-sublabel {
    display: block;
    color: var(--gold, var(--itc-gold-500));
    font-size: 0.8rem;
    margin: 2px 0 6px;
}

.enroll-charge {
    display: grid;
    grid-template-columns: 1.4fr 1fr 42px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

#modal-add .enroll-charge.form-group {
    margin-bottom: 10px;
}

.enroll-charge-remove {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255, 68, 68, 0.35);
    background: rgba(255, 68, 68, 0.08);
    color: #ff7b7b;
    cursor: pointer;
}

.enroll-charge-remove:hover,
.enroll-charge-remove:focus-visible {
    background: rgba(255, 68, 68, 0.18);
}

.enroll-add-charge {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed rgba(212, 175, 55, 0.55);
    background: transparent;
    color: #f2d46f;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.enroll-add-charge:hover,
.enroll-add-charge:focus-visible {
    background: rgba(212, 175, 55, 0.08);
}

.enroll-add-charge:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.enroll-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.06));
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.enroll-total span {
    color: #f8e7a8;
    font-weight: 600;
}

.enroll-total strong {
    color: #ffd84d;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

.enroll-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-size: 0.85rem;
}

.enroll-balance strong {
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.enroll-access {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.enroll-access.is-muted {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.3);
}

.enroll-access-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.18);
    color: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enroll-access.is-muted .enroll-access-icon {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.enroll-access-title {
    color: #f2d46f;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.enroll-access.is-muted .enroll-access-title {
    color: #e2e8f0;
}

.enroll-access-text {
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.45;
}

.enroll-error {
    margin: -4px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #fecaca;
    font-size: 0.82rem;
    line-height: 1.45;
}

.enroll-submit {
    width: 100%;
}

.enroll-submit[aria-busy="true"] {
    opacity: 0.75;
    cursor: progress;
}

/* ── Confirmation ─────────────────────────────────────────────────────── */

.enroll-success {
    text-align: center;
    padding: 10px 6px 0;
}

.enroll-success-badge {
    width: 72px;
    height: 72px;
    margin: 6px auto 0;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    border: 2px solid #22c55e;
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
}

.enroll-success-title {
    margin: 14px 0 4px;
}

.enroll-success-name {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.enroll-success-rows {
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.enroll-success-rows div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--itc-text-secondary);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.enroll-success-rows div:last-child {
    border-bottom: 0;
}

.enroll-success-rows strong {
    color: #fff;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.enroll-success-rows strong.is-paid {
    color: #4ade80;
}

.enroll-success-note {
    margin-top: 14px;
    font-size: 0.78rem;
    line-height: 1.45;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    color: #86efac;
    background: rgba(34, 197, 94, 0.08);
}

.enroll-success-note.is-warning {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.1);
}

.enroll-success-note.is-error {
    color: #fecaca;
    background: rgba(255, 68, 68, 0.1);
}

.enroll-success-note.is-muted {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.1);
}

#modal-access .enroll-success-note {
    margin: 0 0 14px;
}

.enroll-success-receipt {
    width: 100%;
    margin-top: 18px;
}

.enroll-link {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 6px;
    background: none;
    border: 0;
    color: var(--itc-text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

.enroll-link-gold {
    color: #f2d46f;
    font-weight: 600;
}

@media (max-width: 640px) {
    #modal-add .modal-content.enroll-modal,
    #modal-access .modal-content.enroll-modal-small {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        padding: 22px 16px;
    }

    .enroll-grid,
    .enroll-grid-address {
        grid-template-columns: 1fr;
    }

    .enroll-charge {
        grid-template-columns: 1fr 1fr 42px;
    }
}

/* ── Comprobante de pago ──────────────────────────────────────────────── */

#modal-receipt .modal-content.receipt-modal-content {
    width: 820px;
    max-width: calc(100vw - 32px);
    padding: 22px;
    background: #dfe5ee;
    border: 0;
    border-radius: 14px;
    color: #0f172a;
}

.receipt-doc {
    background: #ffffff;
    color: #0f172a;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.receipt-band {
    background-color: #0b3d91;
    background-image: linear-gradient(120deg, #0b3d91 0%, #08245e 55%, #061a42 100%);
    color: #ffffff;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.receipt-rule {
    height: 5px;
    background-color: #c9a84c;
    background-image: linear-gradient(90deg, #a07c30, #ffd700, #c9a84c);
}

.receipt-brand {
    display: flex;
    gap: 16px;
    align-items: center;
}

.receipt-brand img {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #ffd700;
    object-fit: contain;
}

.receipt-brand b {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffd700;
}

.receipt-brand span {
    font-size: 12px;
    color: #c7d2fe;
}

.receipt-heading {
    text-align: right;
}

.receipt-kicker {
    font-size: 10.5px;
    letter-spacing: 2.5px;
    color: #c7d2fe;
    font-weight: 700;
}

.receipt-title {
    font-size: 18px;
    font-weight: 700;
    margin: 2px 0 8px;
    color: #ffffff;
}

.receipt-number {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.6);
    color: #ffd700;
    border-radius: 8px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
}

.receipt-date {
    font-size: 12px;
    color: #c7d2fe;
    margin-top: 6px;
}

.receipt-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    justify-content: center;
    padding: 10px 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
}

.receipt-contact i {
    color: #a07c30;
    margin-right: 4px;
}

.receipt-body {
    padding: 22px 30px 8px;
}

.receipt-cards {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.receipt-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}

.receipt-card h4 {
    margin: 0 0 10px;
    font-size: 11px;
    letter-spacing: 2px;
    color: #a07c30;
}

.receipt-kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    padding: 4px 0;
    color: #64748b;
}

.receipt-kv b {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.receipt-section {
    font-size: 11px;
    letter-spacing: 2px;
    color: #a07c30;
    font-weight: 800;
    margin: 0 0 8px;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-bottom: 20px;
}

.receipt-table th {
    text-align: left;
    font-size: 11px;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
    padding: 9px 12px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.receipt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    color: #0f172a;
}

.receipt-table .receipt-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.receipt-table tr.receipt-total-row td {
    border-bottom: 0;
    border-top: 2px solid #0b3d91;
    font-weight: 800;
    font-size: 15px;
    color: #061a42;
    padding-top: 12px;
}

.receipt-table tr.is-reference td {
    color: #64748b;
}

.receipt-table tr.is-reference .receipt-amount {
    text-decoration: line-through;
}

.receipt-table tr.is-discount td {
    color: #15803d;
}

.receipt-table tr.is-current td {
    background: #fffbea;
}

.receipt-table td.is-empty {
    text-align: center;
    color: #94a3b8;
}

.receipt-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    color: #a07c30;
    background: #fff3c4;
    border-radius: 6px;
    padding: 2px 7px;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.receipt-op {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}

.receipt-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 4px 0 20px;
}

.receipt-tile {
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
}

.receipt-tile span {
    display: block;
    font-size: 10.5px;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
}

.receipt-tile b {
    font-size: 21px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.receipt-tile-total b {
    color: #061a42;
}

.receipt-tile-paid {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.receipt-tile-paid b {
    color: #15803d;
}

.receipt-tile-debt {
    background: #fff7ed;
    border-color: #fed7aa;
}

.receipt-tile-debt b {
    color: #c2410c;
}

.receipt-tile-debt.is-settled {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.receipt-tile-debt.is-settled b {
    color: #15803d;
}

.receipt-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 4px 30px 24px;
    gap: 20px;
}

.receipt-thanks {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    max-width: 400px;
}

.receipt-thanks b {
    color: #061a42;
}

.receipt-sign {
    text-align: center;
    width: 220px;
    flex: none;
}

.receipt-sign-line {
    border-top: 1.5px solid #94a3b8;
    margin-top: 44px;
    margin-bottom: 6px;
}

.receipt-sign span {
    font-size: 11px;
    color: #64748b;
}

.receipt-legal {
    background: #061a42;
    color: #93a4c8;
    font-size: 10.5px;
    text-align: center;
    padding: 9px 20px;
    letter-spacing: 0.3px;
}

.receipt-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
}

.receipt-actions .btn {
    flex: 1;
}

.receipt-print-btn {
    background: #0b3d91;
    color: #ffffff;
    border: 0;
}

.receipt-print-btn:hover,
.receipt-print-btn:focus-visible {
    background: #08245e;
}

/* Écran de téléphone uniquement : le PDF (.is-exporting) garde toujours la
   mise en page « bureau » du document. */
@media (max-width: 640px) {
    .receipt-doc:not(.is-exporting) .receipt-band,
    .receipt-doc:not(.is-exporting) .receipt-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .receipt-doc:not(.is-exporting) .receipt-heading {
        text-align: left;
    }

    .receipt-doc:not(.is-exporting) .receipt-body,
    .receipt-doc:not(.is-exporting) .receipt-band,
    .receipt-doc:not(.is-exporting) .receipt-foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .receipt-doc:not(.is-exporting) .receipt-cards,
    .receipt-doc:not(.is-exporting) .receipt-tiles {
        grid-template-columns: 1fr;
    }

    .receipt-doc:not(.is-exporting) .receipt-sign {
        width: 100%;
    }

    .receipt-actions {
        flex-direction: column;
    }
}

.receipt-doc.is-exporting {
    border-radius: 0;
    box-shadow: none;
}
