/* ==========================================================================
   TTK-AUTH — couche page-unique des pages d'authentification (`_LayoutAuth`)
   --------------------------------------------------------------------------
   Charte : docs/charte-graphique.md (auth = page à style unique).
   Préfixe `ttk-auth-` — même convention que `ttk-dash-` (app/dashboard) et
   `ttk-coaching-meeting.css`. Remplace `auth-premium.css` et ses tokens
   `--auth-*` : ici on ne consomme QUE des tokens de fondation.

   Ne contient que ce qu'aucun archétype ni la fondation ne couvre :
   la coque split-screen, le panneau de marque et la carte d'authentification.
   Tout le transverse (boutons, inputs, alertes, pastilles, spinners, décor de
   fond) vient de `ttk-foundation.css`.

   Sommaire
     1. Corps de page
     2. Coque split-screen
     3. Panneau de marque (desktop)
     4. Carte d'authentification
     5. En-tête de carte
     6. Formulaire
     7. Pied de carte + pied de page
     8. Responsive
     9. Accessibilité (reduced motion)
   ========================================================================== */

/* ==========================================================================
   1. CORPS DE PAGE
   ========================================================================== */
.ttk-auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--ttk-bg-gradient);
    font-family: var(--ttk-font-body);
    color: var(--ttk-text);
    overflow-x: hidden;
}

/* ==========================================================================
   2. COQUE SPLIT-SCREEN
   ========================================================================== */
.ttk-auth-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Colonne du formulaire (droite sur desktop, pleine largeur sur mobile) */
.ttk-auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--ttk-space-6) var(--ttk-space-5);
    min-height: 100vh;
}

/* ==========================================================================
   3. PANNEAU DE MARQUE (masqué sous 1024px)
   ========================================================================== */
.ttk-auth-branding {
    display: none;
    flex: 1;
    background: linear-gradient(135deg, var(--ttk-primary-bg) 0%, transparent 50%);
    padding: var(--ttk-space-8);
    position: relative;
    overflow: hidden;
}
/* Filet vertical de séparation avec la colonne du formulaire */
.ttk-auth-branding::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--ttk-border), transparent);
}

.ttk-auth-branding-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.ttk-auth-logo {
    display: inline-block;
    margin-bottom: var(--ttk-space-8);
    animation: ttk-auth-rise 0.6s var(--ttk-transition-slow) both;
}
.ttk-auth-logo img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 20px var(--ttk-glow));
}

.ttk-auth-branding-text {
    animation: ttk-auth-rise 0.6s var(--ttk-transition-slow) 0.1s both;
}
.ttk-auth-branding-text h2 {
    font-family: var(--ttk-font-title);
    font-size: var(--ttk-text-2xl);
    font-weight: var(--ttk-weight-extrabold);
    line-height: var(--ttk-leading-tight);
    letter-spacing: -0.02em;
    margin: 0 0 var(--ttk-space-4);
    color: var(--ttk-text);
}

/* Nom de marque en dégradé (texte détouré) */
.ttk-auth-brand-accent {
    background: var(--ttk-gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ttk-auth-tagline {
    font-size: var(--ttk-text-md);
    color: var(--ttk-text-secondary);
    line-height: var(--ttk-leading-relaxed);
    margin: 0 0 var(--ttk-space-8);
}

/* -- Promesses de la plateforme (cascade d'entrée) ----------------------- */
.ttk-auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--ttk-space-4);
}

.ttk-auth-feature {
    display: flex;
    align-items: center;
    gap: var(--ttk-space-4);
    padding: var(--ttk-space-4);
    background: var(--ttk-surface-1);
    border: 1px solid var(--ttk-border);
    border-radius: var(--ttk-radius-md);
    transition: background var(--ttk-transition), border-color var(--ttk-transition), transform var(--ttk-transition);
    animation: ttk-auth-slide-in 0.5s var(--ttk-transition-slow) both;
}
.ttk-auth-feature:nth-child(1) { animation-delay: 0.3s; }
.ttk-auth-feature:nth-child(2) { animation-delay: 0.4s; }
.ttk-auth-feature:nth-child(3) { animation-delay: 0.5s; }
.ttk-auth-feature:hover {
    background: var(--ttk-surface-2);
    border-color: var(--ttk-primary);
    transform: translateX(8px);
}
.ttk-auth-feature span {
    font-size: var(--ttk-text-base);
    font-weight: var(--ttk-weight-medium);
    color: var(--ttk-text);
}

/* ==========================================================================
   4. CARTE D'AUTHENTIFICATION
   ========================================================================== */
.ttk-auth-card {
    width: 100%;
    max-width: 420px;
    margin-top: auto;
    background: var(--ttk-surface-solid);
    border: 1px solid var(--ttk-border);
    border-radius: var(--ttk-radius-xl);
    padding: var(--ttk-space-6);
    position: relative;
    box-shadow: var(--ttk-shadow-lg);
    animation: ttk-auth-rise 0.6s var(--ttk-transition-slow) both;
}

/* Liseré lumineux animé (masque XOR : bordure en dégradé sans doubler le fond) */
.ttk-auth-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: calc(var(--ttk-radius-xl) + 1px);
    padding: 1px;
    background: linear-gradient(135deg, var(--ttk-primary), transparent 40%, transparent 60%, var(--ttk-primary-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
    animation: ttk-auth-glow 3s infinite;
}

/* Logo affiché uniquement sous 768px (le panneau de marque est masqué) */
.ttk-auth-mobile-logo {
    display: block;
    text-align: center;
    margin-bottom: var(--ttk-space-6);
}
.ttk-auth-mobile-logo img {
    height: 50px;
    filter: drop-shadow(0 0 15px var(--ttk-glow));
}

/* ==========================================================================
   5. EN-TÊTE DE CARTE
   ========================================================================== */
.ttk-auth-header {
    text-align: center;
    margin-bottom: var(--ttk-space-6);
    animation: ttk-auth-appear 0.5s 0.2s both;
}
.ttk-auth-header h1 {
    font-family: var(--ttk-font-title);
    font-size: var(--ttk-text-lg);
    font-weight: var(--ttk-weight-bold);
    letter-spacing: -0.02em;
    margin: 0 0 var(--ttk-space-2);
    color: var(--ttk-text);
}
.ttk-auth-header p {
    font-size: var(--ttk-text-base);
    color: var(--ttk-text-secondary);
    margin: 0;
}

/* Pastille d'icône de fondation en tête de carte */
.ttk-auth-header .ttk-icon-chip { margin-bottom: var(--ttk-space-5); }

/* Accroche de marque sous le sous-titre */
.ttk-auth-inspire {
    font-size: var(--ttk-text-sm);
    color: var(--ttk-primary-light);
    font-style: italic;
    margin-top: var(--ttk-space-3);
    opacity: 0.8;
}

/* Donnée mise en avant sous l'accroche (ex. adresse email de `auth/verify-email`) */
.ttk-auth-email {
    font-size: var(--ttk-text-md);
    font-weight: var(--ttk-weight-semibold);
    color: var(--ttk-primary-light);
    margin-top: var(--ttk-space-2);
}

/* Rythme vertical des blocs de fondation posés directement dans la carte */
.ttk-auth-card .ttk-alert,
.ttk-auth-card .ttk-instructions { margin-bottom: var(--ttk-space-5); }

/* ==========================================================================
   6. FORMULAIRE
   ========================================================================== */
.ttk-auth-form { animation: ttk-auth-appear 0.5s 0.5s both; }

/* ==========================================================================
   7. PIED DE CARTE + PIED DE PAGE
   ========================================================================== */
.ttk-auth-card-footer {
    text-align: center;
    margin-top: var(--ttk-space-6);
    padding-top: var(--ttk-space-5);
    border-top: 1px solid var(--ttk-border);
    animation: ttk-auth-appear 0.5s 0.6s both;
}
.ttk-auth-card-footer p {
    font-size: var(--ttk-text-sm);
    color: var(--ttk-text-secondary);
    margin: 0;
}
.ttk-auth-card-footer a {
    color: var(--ttk-primary-light);
    font-weight: var(--ttk-weight-medium);
    text-decoration: none;
    transition: color var(--ttk-transition);
}
.ttk-auth-card-footer a:hover {
    color: var(--ttk-primary);
    text-decoration: underline;
}

.ttk-auth-footer {
    text-align: center;
    padding: var(--ttk-space-5);
    margin-top: auto;
    animation: ttk-auth-appear 0.5s 0.7s both;
}
.ttk-auth-footer p {
    font-size: var(--ttk-text-xs);
    color: var(--ttk-text-muted);
    margin: 0 0 var(--ttk-space-2);
}
.ttk-auth-footer-links {
    display: flex;
    justify-content: center;
    gap: var(--ttk-space-5);
}
.ttk-auth-footer-links a {
    font-size: var(--ttk-text-xs);
    color: var(--ttk-text-muted);
    text-decoration: none;
    transition: color var(--ttk-transition);
}
.ttk-auth-footer-links a:hover { color: var(--ttk-text-secondary); }

/* ==========================================================================
   ANIMATIONS (cascade d'entrée de la carte : en-tête 0.2s → formulaire 0.5s
   → pied de carte 0.6s → pied de page 0.7s)
   ========================================================================== */
@keyframes ttk-auth-rise {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ttk-auth-slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ttk-auth-appear {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ttk-auth-glow {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 0.65; }
}

/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */
@media (min-width: 768px) {
    .ttk-auth-card { padding: var(--ttk-space-8); }
    .ttk-auth-mobile-logo { display: none; }
}

@media (min-width: 1024px) {
    .ttk-auth-branding { display: flex; flex: 0 0 50%; max-width: 50%; }
    .ttk-auth-main { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 1280px) {
    .ttk-auth-branding-text h2 { font-size: var(--ttk-text-3xl); }
    .ttk-auth-tagline { font-size: var(--ttk-text-lg); }
    .ttk-auth-card { max-width: 450px; }
}

/* ==========================================================================
   9. ACCESSIBILITÉ — neutralise les animations si demandé
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .ttk-auth-logo,
    .ttk-auth-branding-text,
    .ttk-auth-feature,
    .ttk-auth-card,
    .ttk-auth-card::before,
    .ttk-auth-header,
    .ttk-auth-form,
    .ttk-auth-card-footer,
    .ttk-auth-footer { animation: none !important; }
    .ttk-auth-feature { transition: none !important; }
    .ttk-auth-feature:hover { transform: none; }
}
