/**
 * Tehono Market - Auth Email modal + /connexion/ page
 *
 * Design system : fond sombre (#0f0f11), cartes #1a1a1c, boutons blancs pilule,
 * Montserrat 400/600/700, pas de couleur vive. Correspond au reste du site.
 */

/* ============================================================
   OVERLAY + MODALE
   ============================================================ */

.th-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: "Montserrat", sans-serif;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.th-auth-overlay[hidden] {
    display: none !important;
}
.th-auth-overlay.is-open {
    animation: thAuthFadeIn 0.22s ease-out both;
}

@keyframes thAuthFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.th-auth-modal {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #1a1a1c;
    border: 1px solid #2a2a2c;
    border-radius: 16px;
    padding: 28px 28px 26px;
    color: #f5f5f7;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    animation: thAuthSlideUp 0.26s ease-out both;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

@keyframes thAuthSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Close button - réutilise la classe unifiée .th-modal-close (tehono-public.css) */
.th-auth-modal .th-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* ============================================================
   HEAD
   ============================================================ */

.th-auth-head {
    margin-bottom: 22px;
    text-align: center;
}
.th-auth-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #86868b;
    margin-bottom: 6px;
}
.th-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #f5f5f7;
    margin: 0;
    letter-spacing: -0.01em;
}

/* ============================================================
   TABS
   ============================================================ */

.th-auth-tabs {
    display: flex;
    gap: 4px;
    background: #0f0f11;
    border: 1px solid #2a2a2c;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.th-auth-tab {
    flex: 1;
    border: 0;
    background: transparent;
    color: #86868b;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 6px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}
.th-auth-tab:hover {
    color: #f5f5f7;
}
.th-auth-tab.is-active {
    background: #2a2a2c;
    color: #f5f5f7;
}

/* ============================================================
   PANES (formulaires)
   ============================================================ */

.th-auth-body {
    position: relative;
}
.th-auth-pane {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.th-auth-pane.is-active {
    display: flex;
}

.th-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.th-auth-field > span {
    font-size: 12px;
    font-weight: 600;
    color: #c7c7cc;
    letter-spacing: 0.02em;
}
.th-auth-field input[type="email"],
.th-auth-field input[type="password"],
.th-auth-field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: #0f0f11;
    border: 1px solid #2a2a2c;
    border-radius: 10px;
    padding: 11px 14px;
    color: #f5f5f7;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s;
}
.th-auth-field input:focus {
    outline: none;
    border-color: #86868b;
    background: #151517;
}
.th-auth-field input::placeholder {
    color: #636366;
}
.th-auth-field small {
    font-size: 11px;
    color: #86868b;
    line-height: 1.4;
}

/* RGPD checkbox */
.th-auth-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12px;
    color: #c7c7cc;
    line-height: 1.5;
    cursor: pointer;
    padding: 4px 0;
}
.th-auth-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin: 2px 0 0;
    width: 16px;
    height: 16px;
    accent-color: #f5f5f7;
    cursor: pointer;
}
.th-auth-checkbox a {
    color: #f5f5f7;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.th-auth-checkbox a:hover {
    color: #fff;
}

/* ============================================================
   BOUTONS
   ============================================================ */

.th-auth-btn-primary,
.th-auth-btn-secondary,
.th-auth-btn-wallet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
    border: 1px solid transparent;
}
.th-auth-btn-primary {
    background: #f5f5f7;
    color: #1d1d1f;
    border-color: #f5f5f7;
    margin-top: 4px;
}
.th-auth-btn-primary:hover:not(:disabled) {
    background: #fff;
    border-color: #fff;
}
.th-auth-btn-primary:active {
    transform: translateY(1px);
}
.th-auth-btn-primary:disabled {
    opacity: 0.55;
    cursor: wait;
}

.th-auth-btn-secondary {
    background: transparent;
    color: #f5f5f7;
    border-color: #3a3a3c;
}
.th-auth-btn-secondary:hover {
    border-color: #f5f5f7;
    background: rgba(255, 255, 255, 0.04);
}

.th-auth-btn-wallet {
    background: transparent;
    color: #f5f5f7;
    border-color: #3a3a3c;
}
.th-auth-btn-wallet:hover {
    border-color: #f5f5f7;
    background: rgba(255, 255, 255, 0.04);
}
.th-auth-wallet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

/* Bouton "Continuer avec Google" : meme look que wallet (transparent + bordure
   sombre + hover blanc) pour rester aligne avec le design system. L'icone
   Google multicolore est conservee pour la reconnaissance visuelle. */
.th-auth-btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #3a3a3c;
    background: transparent;
    color: #f5f5f7;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    margin-bottom: 8px;
}
.th-auth-btn-google:hover {
    border-color: #f5f5f7;
    background: rgba(255, 255, 255, 0.04);
}
.th-auth-google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   SÉPARATEUR "ou"
   ============================================================ */

.th-auth-sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 2px;
    color: #636366;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.th-auth-sep::before,
.th-auth-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #2a2a2c;
}

/* ============================================================
   MESSAGES (erreur / succès / info)
   ============================================================ */

.th-auth-error {
    display: none;
    font-size: 12px;
    color: #ffb4b4;
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.25);
    border-radius: 8px;
    padding: 9px 12px;
    line-height: 1.4;
}
.th-auth-error.is-visible {
    display: block;
    animation: th-auth-error-fadein 0.3s ease-out;
}

@keyframes th-auth-error-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Shake feedback quand RGPD non coche : se joue au clic wallet/Google. */
.th-auth-shake {
    animation: th-auth-shake-anim 0.5s cubic-bezier(.36,.07,.19,.97) both;
    background: rgba(255, 77, 77, 0.06);
    border-radius: 8px;
    padding: 6px 8px;
    margin: -6px -8px 10px -8px !important;
    transition: background 0.3s ease;
}
.th-auth-shake input[type="checkbox"] {
    outline: 2px solid rgba(255, 77, 77, 0.5);
    outline-offset: 2px;
}
@keyframes th-auth-shake-anim {
    10%, 90%   { transform: translateX(-2px); }
    20%, 80%   { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60%   { transform: translateX(5px); }
}

.th-auth-success {
    display: none;
    text-align: center;
    padding: 16px 10px 6px;
    font-size: 13px;
    color: #c7c7cc;
    line-height: 1.55;
}
.th-auth-success.is-visible {
    display: block;
}
.th-auth-success strong {
    display: block;
    color: #f5f5f7;
    font-size: 15px;
    margin-bottom: 6px;
}
.th-auth-success .th-auth-success-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.th-auth-info {
    font-size: 12px;
    color: #86868b;
    line-height: 1.5;
    margin: 0 0 2px;
}

/* ============================================================
   PAGE /connexion/ (shortcode [tehono_auth])
   ============================================================ */

.th-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 420px;
    font-family: "Montserrat", sans-serif;
}
.th-auth-card {
    width: 100%;
    max-width: 480px;
    background: #1a1a1c;
    border: 1px solid #2a2a2c;
    border-radius: 16px;
    padding: 36px 32px 32px;
    color: #f5f5f7;
    text-align: center;
}
.th-auth-card .th-auth-kicker {
    margin-bottom: 10px;
}
.th-auth-card .th-auth-title {
    margin-bottom: 12px;
}
.th-auth-card .th-auth-info {
    text-align: center;
    margin-bottom: 22px;
}
.th-auth-page-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.th-auth-reset-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    margin-top: 6px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 480px) {
    .th-auth-modal {
        padding: 22px 20px 20px;
        border-radius: 14px;
    }
    .th-auth-title { font-size: 20px; }
    .th-auth-card { padding: 28px 22px 24px; }
}
