/**
 * Horizon Vérité — V2 P08 : connexion, création de compte et demande de nouveau mot de passe (public/login.html).
 *
 * Chargée après /style.css, /aya-rtl.css et /v2/base.css. Toutes les règles sont limitées à html.hv-p08.
 * La coque (bandeau de marque, langue, carte, champs, Afficher/Masquer, bandeaux) vient de base.css
 * (.hv-shell-autonomous, partagée avec P09) ; cette feuille ne règle que l'agencement propre à la page.
 * Identifiants et classes historiques conservés : le script de la page les pilote (affichage, validation).
 */

/* Canevas de page et contour adouci de la carte (audit couleurs 30/10/2026). */
html.hv-v2.hv-p08,
html.hv-p08 body {
    background: var(--hv-surface-canvas);
}

html.hv-p08 .hv-autonomous-card.p08-card {
    background: var(--hv-surface, var(--color-white));
    border-inline-color: var(--hv-border-subtle);
    border-bottom-color: var(--hv-border-subtle);
    border-radius: 12px;
}

/* Choix du mode : deux commandes, l'état actif se lit au soulignement et au texte, pas seulement à la couleur. */
html.hv-p08 .p08-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--color-secondary-gray);
    border-radius: 0;
}

html.hv-p08 .p08-modes .auth-tab-btn {
    min-width: 0;
    min-height: 48px;
    margin-bottom: -1px;
    padding: 10px 8px;
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    box-shadow: none;
    color: var(--color-dark-gray);
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    cursor: pointer;
}

html.hv-p08 .p08-modes .auth-tab-btn:hover {
    color: var(--hv-link, var(--color-primary));
}

html.hv-p08 .p08-modes .auth-tab-btn[aria-pressed="true"],
html.hv-p08 .p08-modes .auth-tab-btn.active {
    color: var(--hv-link, var(--color-primary));
    border-bottom-color: var(--color-primary);
}

/* Bandeaux : masqués tant que le script ne les affiche pas (style.display = 'block'). */
html.hv-p08 #successBanner,
html.hv-p08 #errorBanner {
    display: none;
}

html.hv-p08 #errorBanner .btn-link-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 4px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--hv-link, var(--color-primary));
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

/* Retour de la demande de lien : le script pose des couleurs en ligne ; la présentation commune les remplace
   (état écrit dans le message lui-même, repère latéral). */
html.hv-p08 #forgotFeedback {
    background: var(--hv-surface, var(--color-white)) !important;
    border: 1px solid var(--color-secondary-gray) !important;
    border-inline-start: 4px solid var(--color-primary) !important;
    color: var(--color-dark-gray) !important;
}

html.hv-p08 #forgotFeedback.is-success {
    border-inline-start-color: #047857 !important;
}

html.hv-p08 #forgotFeedback.is-error {
    border-inline-start-color: #b91c1c !important;
}

/* Formulaires actifs */
html.hv-p08 .p08-section {
    min-width: 0;
}

html.hv-p08 .p08-form {
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

html.hv-p08 #loginFormAccount,
html.hv-p08 #registerForm {
    display: flex;
}

html.hv-p08 .p08-subtitle {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

html.hv-p08 .p08-note,
html.hv-p08 .p08-legal {
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-dark-gray);
}

html.hv-p08 .p08-legal {
    margin: 0;
    text-align: center;
}

/* Passe 4 (30/10/2026) : Cairo (≈ 1,87 em de hauteur de ligne naturelle) ; les liens CGU / confidentialité passés à la
   ligne ne se recouvrent plus et les signes diacritiques gardent leur place. !important : la règle globale
   html[dir="rtl"] * { line-height: 1.7 !important } de style.css. */
html[dir="rtl"].hv-p08 .p08-legal,
html[dir="rtl"].hv-p08 .p08-legal * {
    line-height: 1.9 !important;
}

html.hv-p08 .p08-help {
    margin: -4px 0 0;
    text-align: center;
}

html.hv-p08 .p08-help a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
}

html.hv-p08 .p08-back {
    align-self: center;
    margin: 0;
}

html.hv-p08 .form-label .optional {
    font-weight: 400;
}

html.hv-p08 .p08-required {
    color: inherit;
}

/* Retours de disponibilité (le script ajoute ✓ / ✗ au texte) */
html.hv-p08 .text-success { color: #047857; }
html.hv-p08 .text-danger { color: #b91c1c; }
html.hv-p08 .text-muted { color: var(--color-dark-gray); font-weight: 500; }

/* Offre de bienvenue (feature-gifts.css) : intégrée à la carte, sans second cadre arrondi. */
html.hv-p08 .feature-gifts {
    margin-block: 0 20px;
    border-radius: 3px;
    font-size: 15px;
}

/* Arabe : identifiants, e-mails et pseudonymes saisis gardent une lecture stable (gauche à droite) ;
   l'exemple affiché tant que le champ est vide reste dans le sens de la page. */
html[dir="rtl"].hv-p08 :is(#loginIdentifier, #regUsername, #regEmail, #forgotIdentifier):not(:placeholder-shown) {
    direction: ltr;
    text-align: right;
}

html[dir="rtl"].hv-p08 :is(.p08-modes .auth-tab-btn, .p08-subtitle) {
    font-family: var(--font-arabic);
}

@media (max-width: 375px) {
    html.hv-p08 .p08-modes .auth-tab-btn {
        font-size: 14px;
        padding-inline: 4px;
    }
}

/* Rappel spam et bouton de renvoi de l'e-mail de confirmation (cible tactile >= 44px) */
.hv-p08 #btnResendMail {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 8px 14px;
    font-weight: 700;
    color: #991b1b;
    background: #ffffff;
    border: 1px solid #f87171;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

/* Confirmation d'âge majeur (18+) : cible tactile >= 44 px, variables CSS du thème uniquement. */
html.hv-p08 .p08-age-group {
    margin: 0;
}

html.hv-p08 .p08-age-check {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 8px 12px;
    background: var(--hv-surface-canvas);
    border: 1px solid var(--hv-border-subtle, var(--color-secondary-gray));
    border-radius: 8px;
    color: var(--color-dark-gray);
    font-family: var(--font-ui);
    font-size: 14.5px;
    line-height: 1.5;
    cursor: pointer;
}

html[dir="rtl"].hv-p08 .p08-age-check {
    font-family: var(--font-arabic);
}

html.hv-p08 .p08-age-check input[type="checkbox"] {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}
