/*
Landing Page — landing.css
 */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-family);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* Icône SVG inline réutilisable (helper sp_icon) : base partagée app-wide */
.sp-icon { flex-shrink: 0; vertical-align: middle; }

/* En-tête de page « console » (helper sp_page_header) : titres app uniformes */
.page-head {
    margin-bottom: var(--space-xl);
}
.page-head__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text);
}
.page-head__sub {
    margin: 8px 0 0;
    max-width: 70ch;
    color: var(--color-text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
}

/* Typographie display « Coffre » (Archivo Expanded) 
   Centralisé ici (landing.css est chargé sur toutes les pages) pour éviter
   de répéter la déclaration dans chaque fichier. Réservé aux GRANDS titres,
   avec retenue ; le corps de texte reste en Inter. */
.auth-page__title,
.auth-card__title,
.vault-title,
.download__title,
.legal-card h1 {
    font-family: var(--font-display);
    letter-spacing: -0.005em;
}

/* Utility */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.75rem;
    font-family: var(--font-family);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    line-height: 1;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-fast),
                border-color var(--transition-fast),
                color var(--transition-fast),
                transform var(--transition-fast);
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-on-accent);
    border-color: var(--color-accent);
}
.btn--primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.btn--outline {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn--outline:hover {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn--sm {
    padding: 0.5rem 1.25rem;
    font-size: var(--fs-sm);
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn, .vault-btn, .vault-action-btn, .vault-edit-btn,
.settings-btn, .generator-btn, .auth-submit, .health-issue__action {
    transition: transform var(--transition-fast),
                background-color var(--transition-fast),
                border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}

/* Retour tactile au clic : la touche s'enfonce */
.btn:active, .vault-btn:active, .vault-action-btn:active, .vault-edit-btn:active,
.settings-btn:active, .generator-btn:active, .auth-submit:active,
.health-issue__action:active {
    transform: translateY(1px);
}

/* Focus clavier visible (accessibilité) — halo azur */
.btn:focus-visible, .vault-btn:focus-visible, .vault-action-btn:focus-visible,
.vault-edit-btn:focus-visible, .settings-btn:focus-visible,
.generator-btn:focus-visible, .auth-submit:focus-visible,
.health-issue__action:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Élévation « touche métal » + léger lift au survol — boutons principaux */
.btn--primary, .vault-btn--primary, .settings-btn--primary,
.generator-btn--primary, .auth-submit {
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover, .vault-btn--primary:hover, .settings-btn--primary:hover,
.generator-btn--primary:hover, .auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/*
   THEME TOGGLE
*/
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: var(--space-sm);
}

.theme-toggle__track {
    display: flex;
    align-items: center;
    width: 52px;
    height: 28px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    padding: 3px;
    transition: background-color 0.3s ease;
}

[data-theme="dark"] .theme-toggle__track {
    background: var(--color-accent);
}

.theme-toggle__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.68, -0.15, 0.265, 1.35);
}

[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(24px);
}

.theme-toggle__icon {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
    transition: opacity 0.2s ease;
}

.theme-toggle__icon--sun  { display: block; }
.theme-toggle__icon--moon { display: none; }

[data-theme="dark"] .theme-toggle__icon--sun  { display: none; }
[data-theme="dark"] .theme-toggle__icon--moon { display: block; color: var(--color-primary); }

/*
   NAVBAR
 */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: var(--color-navbar-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/*
   LOGO DE MARQUE : pictogramme SVG + mot-symbole
   Source unique : helper sp_logo() (includes/ui.php), réutilisé navbar /
   footer / barre latérale de l'app. Le bouclier garde le vert de marque (fixe) ;
   le mot « ShieldPass » hérite de currentColor → s'adapte au thème clair/sombre.
   La taille se pilote par `font-size` sur le conteneur ; le pictogramme suit en em.
*/
.sp-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    color: var(--color-text);
    text-decoration: none;
    line-height: 1;
}
.sp-logo__mark {
    height: 1.5em;
    width: auto;
    flex-shrink: 0;
}
.sp-logo__word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1em;
    letter-spacing: -0.01em;
    text-transform: none;   /* neutralise un éventuel uppercase hérité (sidebar) */
    color: currentColor;
    white-space: nowrap;
}

.navbar__logo {
    display: flex;
    align-items: center;
    font-size: 1.35rem;     /* pilote la taille du logo (pictogramme + mot) */
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Petit écran (pages publiques) : les actions deviennent une bande scrollable
   horizontalement pour ne jamais déborder. CSS pur, aucun JS. */
@media (max-width: 640px) {
    .navbar .container { gap: var(--space-sm); }
    .navbar__logo { font-size: 1.2rem; }
    .navbar__actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .navbar__actions::-webkit-scrollbar { display: none; }
    .navbar__actions .btn {
        padding: 0.4rem 0.8rem;
        font-size: var(--fs-xs);
        white-space: nowrap;
    }
    .theme-toggle { flex-shrink: 0; }
}

/*
   FOOTER
 */
.footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-card);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.footer__logo {
    display: flex;
    align-items: center;
    font-size: 1.05rem;     /* pilote la taille du logo (pictogramme + mot) */
}

.footer__copy {
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
}

/* Footer en ligne sur tablette+ */
@media (min-width: 768px) {
    .footer .container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

