/*
 * NOWOTCH.COM
 * DESCRIPTION : feuille de style du formulaire d'inscription (design system partage orange/papier, champs dynamiques) — refonte maquette : conteneur plein ecran en colonne, header sticky (marque + intro + retour), zone de formulaire scrollable et centree (.ins-scroll/.ins-inner)
 * v 1.5.20260801.02
 * CREATION : 2026/07/09
 * MISE A JOUR : 2026/08/01
 *
 * Tous droits réservés.
 * https://nowotch.com/legal/copyright
 */
/* Re-skin sur les tokens partages (styles.css charge AVANT ce fichier) : plus de
   :root local, plus de navy ni de glassmorphism. On ne change que
   couleurs/surfaces/rayons ; la structure (grille .form-row, .phone-line,
   .full-width, media queries) est conservee. */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    /* Refonte maquette : plein ecran, pas de padding qui decalerait le formulaire
       et casserait le header sticky (le scroll vit dans .ins-scroll). */
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    /* Fond papier + halos orange/cuivre : meme motif que .login-wrap. */
    background: var(--paper);
    background-image:
        radial-gradient(circle at 20% 0%, var(--copper-soft) 0%, transparent 40%),
        radial-gradient(circle at 80% 100%, var(--accent-soft) 0%, transparent 45%);
    background-attachment: fixed;
    color: var(--ink);
    display: flex;
    justify-content: center;
}

/* --- Conteneur plein ecran en colonne (header sticky + zone scrollable) --- */
.glass-container {
    /* Fond IDENTIQUE a la page login : transparent -> laisse voir les halos
       orange/cuivre du body (memes gradients que .login-wrap). Pas de surface
       papier opaque ni de degrade propre. */
    background: transparent;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header sticky : marque a gauche, intro au centre, retour a droite --- */
.header-form {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
}

.header-form .intro {
    flex: 1;
    min-width: 220px;
    color: var(--ink-2);
    font-size: 13.5px;
}

.header-form .back {
    width: auto;
    white-space: nowrap;
}

/* --- Zone de formulaire scrollable, contenu centre --- */
.ins-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
}

.ins-inner {
    max-width: 720px;
    margin: 0 auto;
}

/* Decolle le numero de version du bouton « Valider » (scope inscription). */
.ins-inner .nw-version {
    margin-top: 14px;
}

.logo-header {
    max-width: 180px;
    margin-bottom: 20px;
}

.header-form p {
    color: var(--ink-3);
    line-height: 1.6;
}

.link-accueil {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.link-accueil:hover {
    text-underline-offset: 4px;
    text-decoration: underline;
}

/* --- Form Layout --- */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-width {
    grid-column: span 2;
}

/* --- Inputs & Labels --- */
label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 15px;
    color: var(--ink);
    font-size: 1rem;
    transition: border-color 0.12s, box-shadow 0.12s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--paper-2);
}

/* Icone du selecteur de date : native (sombre) en theme clair ; inversee dans
   les themes sombres pour rester visible sur fond fonce. */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="grey"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* --- Dynamic Wrappers (Emails/Phones) --- */
.dynamic-wrapper {
    background: var(--paper-2);
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed var(--line);
    min-height: 50px;
}

/* --- LOT TEL-INDICATIF : ligne indicatif + numéro alignés --- */
/* Le select d'indicatif et le champ numéro cohabitent sur une même ligne. `flex-wrap: wrap`
   garantit un repli propre (numéro sous l'indicatif) sur les écrans très étroits, plutôt qu'un
   débordement ou un écrasement. Le `min-width` sur le numéro déclenche ce repli au besoin. */
.phone-line {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.phone-line select.ccodes {
    flex: 0 0 auto;
    min-width: 110px;
}
.phone-line input[type="tel"] {
    flex: 1 1 auto;
    min-width: 140px;
}

.info-text {
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    color: var(--accent-ink);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* --- Errors --- */
.msg-error {
    color: var(--red);
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
    min-height: 1em;
}

/* --- Legal --- */
.legal-checkboxes {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--paper-2);
    padding: 12px;
    border-radius: var(--radius);
}

.legal-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
}

/* --- Buttons --- */
.btn-submit {
    width: 100%;
    padding: 18px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.btn-submit:disabled {
    background: var(--line);
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- Modal Styling --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 12, 0.45);
    display: none; /* Switch to flex via JS */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--paper);
    padding: 30px;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.btn-primary { background: var(--accent); border:none; padding: 10px 20px; border-radius: var(--radius); color: #fff; cursor: pointer; }
.btn-secondary { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 10px 20px; border-radius: var(--radius); cursor: pointer; }

/* --- Loader --- */
/* Affiché pendant la soumission (upload des pièces jointes) : le JS met
   #loader en display:flex (override du display:none). Overlay papier semi-opaque
   (pas trop transparent, sinon on ne le voit plus) + anneau à sommet accent
   -> l'indicateur reste bien VISIBLE sur le fond clair du re-skin. */
.loader {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: var(--ink-3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .ins-scroll {
        padding: 16px 14px;
    }
}
