/* ============================================================
   landing-start.css
   Onboarding alternatif "OSS Academy style" : hub /start/,
   welcome admin /start/welcome-admin/, code d'invitation
   /start/join/. Hérite des variables CSS de landing.css.

   Mobile-first : layout vertical par défaut, split horizontal
   à partir de 900px.
   ============================================================ */

/* ============================================================
   Layout split — mobile-first vertical
   ============================================================ */
.start-page {
    min-height: 100vh;
    /* Sur mobile/tablette portrait : caler la hauteur sur le viewport réel
       (dvh = dynamic viewport height, exclut les barres navigateur) pour que
       les 3 choix tiennent sans scroll. */
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    background: var(--landing-bg);
    display: flex;
    flex-direction: column;
}

.start-visual {
    position: relative;
    flex: 0 0 auto;
    min-height: 150px;
    /* Stack des backgrounds :
       1. Overlay léger pour atténuer l'image et améliorer la lisibilité du texte
       2. Image hero (chargée si présente dans static/img/landing/start-hero.webp,
          ignorée silencieusement si 404)
       3. Dégradé fallback (rendu si l'image manque) */
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.55) 0%, rgba(21, 28, 38, 0.48) 60%, rgba(15, 23, 42, 0.60) 100%),
        url('/static/img/landing/start-hero.webp') center center / cover no-repeat,
        linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    overflow: hidden;
}

.start-visual-overlay {
    display: none;
}

.start-visual-content {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: auto;
    max-width: 100%;
    text-align: left;
    /* Conteneur sombre arrondi qui regroupe logo + titre + sous-titre */
    background: rgba(0, 0, 0, 0.10);
    border-radius: 14px;
    padding: 14px 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.start-visual-logo {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 16px;
    flex: 0 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.start-visual-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Wrapper simple pour grouper titre + sous-titre (le style est sur .start-visual-content) */
.start-visual-text-box {
    flex: 1;
    min-width: 0;
}

.start-visual-title {
    font-family: var(--landing-font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 6px;
    color: white;
    line-height: 1;
}

.start-visual-tagline {
    font-size: 14px;
    font-weight: 500;
    color: #C19E6F;
    margin: 0;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* ============================================================
   Panneau de choix (droite desktop, bas mobile)
   ============================================================ */
.start-panel {
    flex: 1;
    min-height: 0;            /* autorise le scroll interne dans le flex parent */
    overflow-y: auto;        /* si le contenu dépasse vraiment, le panneau scrolle (pas la page) */
    background: var(--landing-bg-alt);
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

/* Animation swap inline du panneau */
.start-panel {
    transition: opacity 0.18s ease, transform 0.22s ease;
}

.start-panel-loading {
    opacity: 0.85;
}

.start-panel-leaving {
    opacity: 0;
    transform: translateX(8px);
}

.start-panel-entering {
    opacity: 0;
    transform: translateX(-8px);
}

@media (prefers-reduced-motion: reduce) {
    .start-panel,
    .start-panel-leaving,
    .start-panel-entering {
        transition: none;
        transform: none;
    }
}

/* Card cliquable (Créer / Rejoindre) */
.start-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 14px 0;
    text-decoration: none !important;
    color: inherit !important;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.start-card:hover { opacity: 0.85; }

.start-card-overline {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--landing-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.start-card-title {
    font-family: var(--landing-font-display);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--landing-primary);
    margin: 0 0 6px;
    line-height: 1.1;
}

.start-card-desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--landing-text-light);
    margin: 0 0 10px;
    line-height: 1.4;
    max-width: 540px;
}

.start-card-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--landing-primary);
    color: var(--landing-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.start-card:hover .start-card-arrow {
    background: var(--landing-primary);
    color: white;
    transform: translateX(4px);
}

.start-divider {
    height: 1px;
    background: #d1d5db;
    margin: 0 -8px;
}

/* Footer "Déjà inscrit ?" */
.start-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--landing-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 14px;
    color: var(--landing-text-light);
}

.start-login-link {
    color: var(--landing-primary) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.start-login-link:hover { text-decoration: underline !important; }


/* ============================================================
   Viewports courts (< 900px en hauteur) sous le split desktop :
   téléphones paysage + petites tablettes paysage. On compacte
   davantage pour que les 3 choix restent visibles sans scroll.
   ============================================================ */
@media (max-width: 899px) and (max-height: 700px) {
    .start-visual { min-height: 0; padding: 16px 20px; }
    .start-visual-logo { width: 48px; height: 48px; border-radius: 12px; }
    .start-visual-title { font-size: 20px; margin-bottom: 2px; }
    .start-visual-tagline { font-size: 12px; line-height: 1.3; }
    .start-visual-content { padding: 10px 16px; gap: 12px; }

    .start-panel { padding: 12px 24px 14px; }
    .start-card { padding: 9px 0; }
    .start-card-title { font-size: 19px; margin-bottom: 4px; }
    .start-card-desc { font-size: 12px; margin-bottom: 6px; }
    .start-card-overline { margin-bottom: 3px; }
    .start-card-arrow { width: 32px; height: 32px; font-size: 15px; }
}

/* Cas extrême (très courts, ex. téléphone paysage) : on masque le
   bandeau visuel pour gagner de la place, mais on GARDE les
   descriptions sous chaque titre (juste un poil plus petites). */
@media (max-width: 899px) and (max-height: 480px) {
    .start-visual { display: none; }
    .start-card-desc { font-size: 11px; margin-bottom: 5px; line-height: 1.3; }
}

/* ============================================================
   Desktop ≥ 900px : split horizontal 50/50
   ============================================================ */
@media (min-width: 900px) {
    .start-page {
        flex-direction: row;
        height: 100vh;
        /* Hauteur réelle du viewport (exclut les barres navigateur) +
           on interdit tout débordement de la page → jamais de scroll global.
           Si le contenu est trop grand, c'est le panneau qui scrolle en interne. */
        height: 100dvh;
        overflow: hidden;
    }

    .start-visual {
        flex: 1 1 50%;
        min-height: 0;
        padding: 48px 48px 72px;
    }

    .start-visual-logo {
        width: 88px;
        height: 88px;
        border-radius: 22px;
    }

    .start-visual-title { font-size: 44px; letter-spacing: 2px; margin-bottom: 8px; }
    .start-visual-tagline { font-size: 16px; }
    .start-visual-content { padding: 18px 28px; border-radius: 18px; gap: 20px; }

    .start-panel {
        flex: 1 1 50%;
        padding: 64px 80px 48px;
        max-width: 720px;
        /* Le panneau ne dépasse jamais la hauteur écran ; s'il le fallait
           vraiment, il scrolle en interne (pas la page entière). */
        max-height: 100dvh;
        overflow-y: auto;
    }

    .start-card { padding: 24px 0; }
    .start-card-title { font-size: 32px; margin-bottom: 10px; }
    .start-card-desc { font-size: 14px; margin-bottom: 14px; }
    .start-card-arrow { width: 48px; height: 48px; font-size: 20px; }
    .start-divider { margin: 0 -56px; }
}

/* ------------------------------------------------------------
   Desktop split MAIS viewport court (tablette en PAYSAGE :
   large ≥ 900px mais haute ≤ 820px). On compacte le panneau
   pour que les 3 choix tiennent sans scroll vertical.
   ------------------------------------------------------------ */
@media (min-width: 900px) and (max-height: 820px) {
    .start-panel {
        padding: 24px 80px;
        justify-content: center;
    }
    .start-card { padding: 14px 0; }
    .start-card-overline { margin-bottom: 5px; }
    .start-card-title { font-size: 26px; margin-bottom: 5px; }
    .start-card-desc { font-size: 13px; margin-bottom: 8px; line-height: 1.35; }
    .start-card-arrow { width: 38px; height: 38px; font-size: 16px; }
}

/* Tablette paysage très courte (≤ 680px) : on compacte encore mais
   on GARDE les descriptions (texte plus petit). */
@media (min-width: 900px) and (max-height: 680px) {
    .start-panel { padding: 16px 80px; }
    .start-card { padding: 11px 0; }
    .start-card-desc { font-size: 12px; margin-bottom: 6px; line-height: 1.3; }
    .start-card-title { font-size: 24px; }
}

@media (min-width: 1280px) {
    .start-panel { padding: 64px 120px 48px; }
    .start-card-title { font-size: 40px; }
}


/* ============================================================
   Welcome admin — stepper + parcours
   ============================================================ */
.start-panel-welcome {
    position: relative;
    justify-content: flex-start;
    padding-top: 56px;
}

.start-back-link {
    position: absolute;
    top: 20px;
    left: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    color: var(--landing-primary) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

.start-back-link:hover { background: rgba(0, 0, 0, 0.05); }

/* Stepper */
.start-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    padding-top: 8px;
}

.start-stepper .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--landing-border);
    color: var(--landing-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.step.active .step-circle {
    background: #16a34a;
    color: white;
}

.step.current .step-circle {
    background: var(--landing-primary);
    color: white;
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--landing-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step.active .step-label,
.step.current .step-label { color: var(--landing-primary); }

.step-line {
    flex: 1;
    height: 2px;
    background: var(--landing-border);
    margin-bottom: 18px;
    min-width: 20px;
}

/* Bloc bienvenue */
.welcome-overline {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--landing-text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.welcome-title {
    font-family: var(--landing-font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--landing-primary);
    margin: 0 0 10px;
    line-height: 1.15;
}

.welcome-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--landing-text-light);
    margin: 0 0 32px;
    line-height: 1.5;
}

/* Parcours */
.welcome-journey { margin-bottom: 32px; }

.journey-heading {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--landing-text-muted);
    text-transform: uppercase;
    margin: 0 0 16px;
}

.journey-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.journey-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 4px 0;
}

.journey-item > i {
    font-size: 22px;
    color: var(--landing-text-light);
    flex: 0 0 auto;
    margin-top: 2px;
}

.journey-item-highlight > i {
    color: var(--landing-accent);
}

.journey-item strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--landing-primary);
    margin-bottom: 2px;
}

.journey-item span {
    font-size: 13px;
    color: var(--landing-text-light);
    line-height: 1.4;
}

/* CTA primaire */
.start-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--landing-primary);
    color: white !important;
    border-radius: var(--landing-radius);
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: background 0.2s ease, transform 0.15s ease;
    align-self: flex-start;
}

.start-cta:hover { background: var(--landing-primary-light); }
.start-cta:active { transform: scale(0.98); }

.start-cta i { font-size: 18px; }

@media (min-width: 900px) {
    .start-panel-welcome { padding: 64px 80px 48px; }
    .welcome-title { font-size: 36px; }
    .welcome-subtitle { font-size: 16px; }
    .step-circle { width: 36px; height: 36px; font-size: 14px; }
    .step-label { font-size: 12px; }
}


/* ============================================================
   Page saisie code d'invitation
   ============================================================ */
.join-code-form {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.join-code-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--landing-primary);
    margin-bottom: 8px;
}

.join-code-input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--landing-border);
    border-radius: var(--landing-radius);
    font-family: var(--landing-font);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    color: var(--landing-primary);
    background: var(--landing-bg);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.join-code-input:focus {
    border-color: var(--landing-primary);
    box-shadow: 0 0 0 4px rgba(21, 28, 38, 0.08);
}

.join-code-input::placeholder {
    color: var(--landing-text-muted);
    font-weight: 600;
    letter-spacing: 2px;
}

.join-code-hint {
    font-size: 12px;
    color: var(--landing-text-light);
    margin: 8px 0 24px;
    line-height: 1.4;
}

.join-code-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--landing-text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.join-code-divider::before,
.join-code-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--landing-border);
}

.join-code-qr-hint {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--landing-bg);
    border: 1px solid var(--landing-border);
    border-radius: var(--landing-radius);
    margin-bottom: 24px;
}

.join-code-qr-hint > i {
    font-size: 28px;
    color: var(--landing-primary);
    flex: 0 0 auto;
    margin-top: 2px;
}

.join-code-qr-hint strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--landing-primary);
    margin-bottom: 4px;
}

.join-code-qr-hint span {
    font-size: 12px;
    color: var(--landing-text-light);
    line-height: 1.4;
}

@media (min-width: 900px) {
    .join-code-input { font-size: 26px; padding: 18px 20px; }
}


/* ============================================================
   Formulaire login + register dans le hub
   ============================================================ */

/* Panel pour les forms longs (register) : scroll interne */
.start-panel-form {
    overflow-y: auto;
}

/* Field générique */
.start-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}

.start-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--landing-primary);
    margin-bottom: 6px;
}

.start-field-optional {
    font-size: 11px;
    font-weight: 400;
    color: var(--landing-text-muted);
    text-transform: lowercase;
    margin-left: 4px;
}

.start-field input[type="text"],
.start-field input[type="email"],
.start-field input[type="tel"],
.start-field input[type="password"],
.start-field select,
.start-field .landing-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--landing-border);
    border-radius: 10px;
    font-family: var(--landing-font);
    font-size: 14px;
    color: var(--landing-primary);
    background: var(--landing-bg);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.start-field input:focus,
.start-field select:focus,
.start-field .landing-input:focus {
    border-color: var(--landing-primary);
    box-shadow: 0 0 0 4px rgba(21, 28, 38, 0.08);
}

.start-field-error {
    font-size: 12px;
    color: #b91c1c;
    margin-top: 4px;
}

/* Field avec icône (login) */
.start-field-input {
    position: relative;
    display: flex;
    align-items: center;
}

.start-field-input > i {
    position: absolute;
    left: 14px;
    color: var(--landing-text-muted);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.start-field-input input {
    padding-left: 40px !important;
}

.start-field-eye {
    position: absolute;
    right: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--landing-text-muted);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 16px;
    transition: background 0.15s ease, color 0.15s ease;
}

.start-field-eye:hover { background: var(--landing-bg-alt); color: var(--landing-primary); }

/* Row 2 colonnes */
.start-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Section avec numéro */
.start-form-section {
    margin-bottom: 24px;
    padding-bottom: 4px;
}

.start-form-section + .start-form-section {
    border-top: 1px solid var(--landing-border);
    padding-top: 24px;
}

.start-form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--landing-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--landing-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px;
}

.start-form-section-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--landing-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* Erreur globale */
.start-form-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #991b1b;
}

.start-form-error > i {
    font-size: 18px;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Encart confiance trial */
.start-trust-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--landing-bg-alt);
    border: 1px solid var(--landing-border);
    border-radius: 10px;
    margin: 8px 0 16px;
    font-size: 13px;
    color: var(--landing-text-light);
    line-height: 1.4;
}

.start-trust-row > i {
    font-size: 18px;
    color: #16a34a;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Meta du login (remember + forgot) */
.start-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 18px;
    font-size: 13px;
}

.start-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--landing-text-light);
}

.start-checkbox input { margin: 0; cursor: pointer; }

.start-forgot-link {
    color: var(--landing-primary) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    font-size: 13px;
}

.start-forgot-link:hover { text-decoration: underline !important; }

/* Pied de form (lien Créer/Connexion) */
.start-form-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--landing-text-light);
}

.start-form-footer .start-login-link {
    margin-left: 4px;
}

@media (max-width: 540px) {
    .start-form-row { grid-template-columns: 1fr; }
}
