/* ============================================================
   VARIABLES — V2 Design System (aligné sur styles.css)
============================================================ */
:root {
    --hx-paper:    #FAF5EB;
    --hx-paper-2:  #F2E8D2;
    --hx-ink:      #2A1F14;
    --hx-ink-2:    rgba(42, 31, 20, 0.62);
    --hx-ink-3:    rgba(42, 31, 20, 0.38);
    --hx-line:     rgba(42, 31, 20, 0.14);
    --hx-ochre:    #C8862A;
    --hx-red:      #B83A2A;
    --hx-red-2:    #8E2818;
    --hx-jade:     #6B7F4A;
    --hx-card:     #FFFCF5;
    --hx-font-display: "Cormorant Garamond", Georgia, serif;
    --hx-font-body:    "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--hx-font-body);
    background: var(--hx-paper);
    color: var(--hx-ink);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============================================================
   CONTAINER
============================================================ */
.login-container {
    background: var(--hx-card);
    border-radius: 20px;
    border: 1px solid var(--hx-line);
    box-shadow: 0 8px 40px rgba(42, 31, 20, 0.12);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

/* ============================================================
   HEADER
============================================================ */
.login-header {
    background: var(--hx-ink);
    color: #FFF8EA;
    padding: 26px 24px 30px;
    text-align: center;
    position: relative;
}
.login-header::after {
    content: "";
    position: absolute;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 36px; height: 3px;
    background: var(--hx-ochre);
    border-radius: 2px;
}

.login-lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    margin-bottom: 20px;
    background: rgba(255,248,234,.08);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid rgba(255,248,234,.12);
    width: fit-content;
    margin-left: auto;
}
.login-lang-btn {
    background: transparent;
    border: none;
    color: rgba(255,248,234,.55);
    border-radius: 8px; padding: 5px 10px;
    font-size: .76rem; font-weight: 700;
    cursor: pointer; transition: all .18s;
    font-family: var(--hx-font-body);
}
.login-lang-btn.active {
    background: rgba(255,248,234,.18);
    color: #FFF8EA;
}
.login-lang-btn:hover:not(.active) { color: #FFF8EA; background: rgba(255,248,234,.10); }

.login-header h1 {
    font-family: var(--hx-font-display);
    font-size: 2em;
    font-weight: 500;
    font-style: italic;
    letter-spacing: -.01em;
    color: #FFF8EA;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-header p {
    color: rgba(255,248,234,.55);
    font-size: .86em;
    font-weight: 500;
}

/* Sceau — copié depuis hx-seal (styles.css) */
.login-seal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0;
    background: var(--hx-red);
    color: #FFF8EA;
    font-family: var(--hx-font-display); font-weight: 600; font-size: 14px; line-height: 1;
    transform: rotate(-4deg); border-radius: 3px;
    box-shadow: inset 0 0 0 1.5px rgba(255,248,234,.18), inset 0 0 12px rgba(0,0,0,.18);
    letter-spacing: .02em;
}

/* ============================================================
   TABS
============================================================ */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--hx-line);
}
.tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-size: .93em;
    font-weight: 600;
    font-family: var(--hx-font-body);
    color: var(--hx-ink-3);
    transition: color .2s, border-color .2s;
}
.tab:hover { color: var(--hx-red); }
.tab.active {
    color: var(--hx-red);
    border-bottom-color: var(--hx-red);
}

/* ============================================================
   FORMULAIRES
============================================================ */
.auth-form {
    display: none;
    padding: 26px 28px 18px;
    animation: slideIn .25s ease;
}
.auth-form.active { display: block; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: .84em;
    font-weight: 700;
    color: var(--hx-ink);
    letter-spacing: .01em;
}
.form-group label .required { color: var(--hx-red); margin-left: 2px; }

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--hx-line);
    border-radius: 10px;
    font-size: .93em;
    font-family: var(--hx-font-body);
    transition: border-color .2s, box-shadow .2s;
    background: var(--hx-paper);
    color: var(--hx-ink);
    appearance: none; -webkit-appearance: none;
}
.form-group input:focus {
    outline: none;
    border-color: var(--hx-ochre);
    box-shadow: 0 0 0 3px rgba(200,134,42,.10);
    background: var(--hx-card);
}
.form-group input::placeholder { color: var(--hx-ink-3); }

/* ============================================================
   BOUTONS
============================================================ */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--hx-ink);
    color: #FFF8EA;
    border: none;
    border-radius: 999px;
    font-size: .93em;
    font-weight: 700;
    font-family: var(--hx-font-body);
    cursor: pointer;
    transition: box-shadow .2s, transform .15s, background .2s;
    margin-top: 10px;
}
.btn-primary:hover  { background: var(--hx-red); box-shadow: 0 4px 16px rgba(184,58,42,.22); transform: translateY(-1px); }
.btn-primary:active { transform: scale(.98); }

.btn-google {
    width: 100%;
    padding: 12px;
    background: var(--hx-card);
    color: var(--hx-ink);
    border: 1px solid var(--hx-line);
    border-radius: 999px;
    font-size: .9em;
    font-weight: 600;
    font-family: var(--hx-font-body);
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-google:hover {
    border-color: var(--hx-ochre);
    box-shadow: 0 2px 10px rgba(42,31,20,.08);
}

.btn-resend {
    display: inline-block; margin-top: 8px;
    background: none;
    border: 1px solid var(--hx-red);
    border-radius: 999px;
    color: var(--hx-red);
    padding: 5px 14px; font-size: .82em; font-weight: 700;
    cursor: pointer; transition: background .2s;
    font-family: var(--hx-font-body);
}
.btn-resend:hover    { background: rgba(184,58,42,.08); }
.btn-resend:disabled { opacity: .45; cursor: default; }

/* ============================================================
   MESSAGES ÉTAT
============================================================ */
.error-message {
    color: var(--hx-red);
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(184,58,42,.07);
    border: 1px solid rgba(184,58,42,.18);
    border-radius: 8px;
    font-size: .84em;
    line-height: 1.5;
    display: none;
}
.error-message.show { display: block; }

.success-message {
    color: #3A5A1A;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(107,127,74,.10);
    border: 1px solid rgba(107,127,74,.22);
    border-radius: 8px;
    font-size: .84em;
    line-height: 1.5;
    display: none;
}
.success-message.show { display: block; }

.loading {
    display: none;
    text-align: center;
    color: var(--hx-ink-2);
    font-size: .84em;
    margin-top: 8px;
}

/* ============================================================
   CONNEXION SOCIALE
============================================================ */
.social-login {
    margin-top: 12px;
    padding: 16px 28px 10px;
    border-top: 1px solid var(--hx-line);
}
.social-separator {
    text-align: center;
    color: var(--hx-ink-3);
    font-size: .82em;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

/* ============================================================
   LIENS & FOOTER
============================================================ */
.forgot-link {
    display: block;
    text-align: right;
    color: var(--hx-ink-2);
    font-size: .82em;
    background: none;
    border: none;
    padding: 4px 0 0;
    cursor: pointer;
    font-family: var(--hx-font-body);
    width: 100%;
    transition: color .2s;
}
.forgot-link:hover { color: var(--hx-red); text-decoration: underline; }

.forgot-section {
    margin-top: 12px;
    padding: 14px;
    background: var(--hx-paper);
    border-radius: 10px;
    border: 1px solid var(--hx-line);
    display: none;
}
.forgot-section.show { display: block; animation: slideIn .25s ease; }
.forgot-section p { font-size: .84em; color: var(--hx-ink-2); margin-bottom: 10px; line-height: 1.5; }

.back-link {
    text-align: center;
    margin-top: 14px;
    padding: 0 28px 22px;
}
.back-link a {
    color: var(--hx-ink-2);
    text-decoration: none;
    font-size: .86em;
    font-weight: 600;
    transition: color .2s;
}
.back-link a:hover { color: var(--hx-red); }

.privacy-footer {
    text-align: center;
    padding: 8px 28px 16px;
    font-size: .74em;
    color: var(--hx-ink-3);
    border-top: 1px solid var(--hx-line);
}
.privacy-footer a { color: var(--hx-ink-2); text-decoration: none; }
.privacy-footer a:hover { color: var(--hx-red); text-decoration: underline; }

/* ============================================================
   RÈGLES MOT DE PASSE
============================================================ */
.pwd-rules {
    list-style: none; margin: 8px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.pwd-rules li {
    font-size: .8em; color: var(--hx-ink-3);
    display: flex; align-items: center; gap: 6px;
    transition: color .2s;
}
.pwd-rules li::before {
    content: '✗'; font-size: .8em; font-weight: 700;
    color: var(--hx-ink-3); width: 14px; text-align: center; flex-shrink: 0;
}
.pwd-rules li.ok { color: #3A5A1A; }
.pwd-rules li.ok::before { content: '✓'; color: #3A5A1A; }

/* ============================================================
   RÉTENTION
============================================================ */
.retention-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--hx-ink);
    font-size: .86em;
}
.retention-options {
    display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px;
}
.retention-option {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--hx-line);
    border-radius: 999px;
    cursor: pointer;
    font-size: .83em; font-weight: 600;
    color: var(--hx-ink-2);
    transition: all .18s;
    user-select: none;
}
.retention-option:has(input:checked) {
    border-color: var(--hx-red);
    background: rgba(184,58,42,.07);
    color: var(--hx-red);
}
.retention-option input[type="radio"] { display: none; }
.retention-note {
    font-size: .75em; color: var(--hx-ink-3); margin-top: 4px; line-height: 1.55;
}

/* ============================================================
   CONSENTEMENT
============================================================ */
.consent-group {
    display: flex; align-items: flex-start; gap: 10px;
    margin-top: 14px; margin-bottom: 4px;
}
.consent-group input[type="checkbox"] {
    width: 17px; height: 17px; min-width: 17px;
    margin-top: 2px; accent-color: var(--hx-red); cursor: pointer;
}
.consent-group label {
    font-size: .83em; color: var(--hx-ink-2); line-height: 1.55; cursor: pointer;
}
.consent-group label a { color: var(--hx-red); text-decoration: underline; }

/* ============================================================
   MODAL RÉTENTION (Google SSO)
============================================================ */
#retention-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(42,31,20,.48);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center; justify-content: center; padding: 20px;
}
#retention-modal.show { display: flex; }
.retention-modal-box {
    background: var(--hx-card);
    border-radius: 20px;
    border: 1px solid var(--hx-line);
    padding: 28px 28px 24px;
    max-width: 440px; width: 100%;
    box-shadow: 0 16px 60px rgba(42,31,20,.16);
    animation: slideIn .25s ease;
}
.retention-modal-box h2 {
    color: var(--hx-ink);
    margin-bottom: 8px;
    font-family: var(--hx-font-display);
    font-size: 1.45em; font-weight: 500; font-style: italic;
}
.retention-modal-box > p {
    color: var(--hx-ink-2);
    font-size: .88em; margin-bottom: 20px; line-height: 1.55;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 600px) {
    .login-container { max-width: 100%; border-radius: 16px; }
    .login-header h1 { font-size: 1.7em; }
    .auth-form { padding: 20px 20px 14px; }
    .social-login { padding: 14px 20px 8px; }
    .back-link { padding: 0 20px 18px; }
    .privacy-footer { padding: 8px 20px 14px; }
}

/* Paysage téléphone : hauteur insuffisante pour centrer verticalement */
@media (max-height: 650px) {
    body { align-items: flex-start; padding-top: 24px; }
}
