/* ============================================
   PAGE D'AUTHENTIFICATION — DESIGN MODERNE
   Thème : shoptimizer
   ============================================ */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    /* --auth-primary, --auth-primary-hover, --auth-btn-text,
       --auth-link, --auth-link-hover
       sont injectés depuis functions.php via wp_add_inline_style
       à partir des options du thème (Customizer). */

    --auth-bg-page:        #f9fafb;
    --auth-bg-card:        #ffffff;
    --auth-bg-subtle:      #fafafa;
    --auth-bg-footer:      #f9fafb;

    --auth-border:         #e5e7eb;
    --auth-border-input:   #d1d5db;
    --auth-border-hover:   #9ca3af;

    --auth-text-primary:   #111827;
    --auth-text-secondary: #374151;
    --auth-text-muted:     #6b7280;
    --auth-text-hint:      #9ca3af;

    --auth-danger-bg:      #fef2f2;
    --auth-danger-border:  #fecaca;
    --auth-danger-text:    #dc2626;

    --auth-success-bg:     #f0fdf4;
    --auth-success-border: #86efac;
    --auth-success-text:   #166534;

    --auth-info-bg:        #eff6ff;
    --auth-info-border:    #93c5fd;
    --auth-info-text:      #1d4ed8;

    --auth-radius-sm:      4px;
    --auth-radius-md:      6px;
    --auth-radius-lg:      8px;

    --auth-transition:     0.15s ease;
}

/* ============================================
   MASQUER CHROME DU THÈME SHOPTIMIZER
   ============================================ */
body.woocommerce-account:not(.logged-in) .site-header,
body.woocommerce-account:not(.logged-in) .col-full-nav,
body.woocommerce-account:not(.logged-in) .site-footer,
body.woocommerce-account:not(.logged-in) .woocommerce-breadcrumb,
body.woocommerce-account:not(.logged-in) .entry-header,
body.woocommerce-account:not(.logged-in) .page-title,
body.woocommerce-account:not(.logged-in) #secondary,
body.woocommerce-account:not(.logged-in) .s-observer {
    display: none !important;
}

html {
    color-scheme: only light;
}

body.woocommerce-account:not(.logged-in) {
    color-scheme: only light;
    background: var(--auth-bg-page) !important;
    min-height: 100vh;
}

body.woocommerce-account:not(.logged-in) #content,
body.woocommerce-account:not(.logged-in) .col-full,
body.woocommerce-account:not(.logged-in) .content-area,
body.woocommerce-account:not(.logged-in) article,
body.woocommerce-account:not(.logged-in) .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    background: transparent !important;
}

body.woocommerce-account .below-content,
body.woocommerce-account footer.copyright,
body.woocommerce-account .header-widget-region {
    display: none !important;
}

/* ============================================
   PAGE CONTAINER
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--auth-bg-page);
    box-sizing: border-box;
}

/* ============================================
   CARD PRINCIPALE
   ============================================ */
.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ============================================
   EN-TÊTE
   ============================================ */
.auth-header {
    padding: 20px 24px 16px;
    text-align: center;
    background: var(--auth-bg-card);
    border-bottom: 1px solid var(--auth-border);
}

.auth-logo {
    display: inline-block;
    text-decoration: none;
}

.auth-logo img {
    max-height: 36px;
    width: auto;
}

.auth-logo .logo-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--auth-primary);
}

/* ============================================
   ONGLETS
   ============================================ */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--auth-border);
    background: var(--auth-bg-subtle);
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--auth-transition), background var(--auth-transition);
}

.auth-tab:hover {
    color: var(--auth-text-secondary);
    background: var(--auth-border);
}

.auth-tab.active {
    background: var(--auth-bg-card);
    color: var(--auth-primary);
    border-bottom-color: var(--auth-primary);
}

/* ============================================
   FORMULAIRES
   ============================================ */
.auth-forms {
    padding: 20px 24px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--auth-text-primary);
    text-align: center;
    margin: 0 0 16px;
}

/* ============================================
   CONNEXION SOCIALE
   ============================================ */
.social-login {
    margin-bottom: 16px;
}

.social-login .nsl-container,
.social-login .nsl-container-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.social-login .nsl-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    height: 40px !important;
    background: var(--auth-bg-card) !important;
    border: 1px solid var(--auth-border-input) !important;
    border-radius: var(--auth-radius-md) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--auth-text-secondary) !important;
    box-shadow: none !important;
    padding: 0 14px !important;
    margin: 0 !important;
    transition: background var(--auth-transition), border-color var(--auth-transition) !important;
}

.social-login .nsl-button:hover {
    background: var(--auth-bg-subtle) !important;
    border-color: var(--auth-border-hover) !important;
}

.social-login .nsl-button-icon {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
}

.social-login .nsl-button-label {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--auth-text-secondary) !important;
}

/* ============================================
   SÉPARATEUR
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    gap: 10px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider span {
    font-size: 12px;
    font-weight: 400;
    color: var(--auth-text-hint);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CHAMPS
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text-secondary);
    margin-bottom: 4px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.label-row label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 13px;
    font-weight: 400;
    color: var(--auth-link);
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--auth-link-hover);
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--auth-text-hint);
    pointer-events: none;
    transition: color var(--auth-transition);
}

.input-wrapper input {
    width: 100%;
    height: 40px;
    padding: 0 38px;
    font-size: 14px;
    color: var(--auth-text-primary);
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border-input);
    border-radius: var(--auth-radius-md);
    outline: none;
    transition: border-color var(--auth-transition), box-shadow var(--auth-transition);
}

.input-wrapper input::placeholder {
    color: var(--auth-text-hint);
}

.input-wrapper input:hover {
    border-color: var(--auth-border-hover);
}

.input-wrapper input:focus {
    border-color: var(--auth-primary);
    box-shadow: none;
}

.input-wrapper:focus-within .input-icon {
    color: var(--auth-primary);
}

.toggle-password {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    color: var(--auth-text-hint);
    transition: color var(--auth-transition);
}

.toggle-password:hover {
    color: var(--auth-text-muted);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   BOUTON PRINCIPAL
   ============================================ */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    margin-top: 6px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-btn-text);
    background: var(--auth-primary);
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: background var(--auth-transition);
}

.btn-primary:hover {
    background: var(--auth-primary-hover);
    color: var(--auth-btn-text);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}


/* ============================================
   LIGNE DOUBLE (Prénom + Nom)
   ============================================ */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 380px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FEEDBACK INLINE
   ============================================ */
.field-feedback {
    font-size: 12px;
    margin-top: 4px;
}

.field-feedback.error {
    color: var(--auth-danger-text);
}

.field-feedback.success {
    color: var(--auth-success-text);
}

.field-feedback a {
    color: inherit;
    font-weight: 600;
}


/* ============================================
   CHAMP REQUIS
   ============================================ */
.required {
    color: var(--auth-danger-text);
    font-weight: 600;
}

/* ============================================
   FORCE DU MOT DE PASSE
   ============================================ */
.password-strength {
    margin-top: 6px;
    display: none;
}

.password-strength.visible {
    display: block;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.strength-bar span {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--auth-border);
    transition: background 0.2s;
}

.password-strength.weak   .strength-bar span:nth-child(1)               { background: var(--auth-danger-text); }
.password-strength.medium .strength-bar span:nth-child(1),
.password-strength.medium .strength-bar span:nth-child(2)               { background: #f59e0b; }
.password-strength.strong .strength-bar span                            { background: var(--auth-success-text); }

.strength-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--auth-text-hint);
}

.password-strength.weak   .strength-label { color: var(--auth-danger-text); }
.password-strength.medium .strength-label { color: #f59e0b; }
.password-strength.strong .strength-label { color: var(--auth-success-text); }

/* ============================================
   MENTIONS LÉGALES
   ============================================ */
.terms-text {
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.6;
    margin: 14px 0;
}

.terms-text a {
    color: var(--auth-link);
    text-decoration: none;
}

.terms-text a:hover {
    color: var(--auth-link-hover);
    text-decoration: underline;
}

/* ============================================
   LIEN BASCULE (connexion ↔ inscription)
   ============================================ */
.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--auth-text-muted);
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--auth-border);
}

.auth-switch a {
    font-weight: 600;
    color: var(--auth-link);
    text-decoration: none;
}

.auth-switch a:hover {
    color: var(--auth-link-hover);
    text-decoration: underline;
}

/* ============================================
   PIED DE CARTE
   ============================================ */
.auth-footer {
    padding: 12px 24px;
    background: var(--auth-bg-footer);
    border-top: 1px solid var(--auth-border);
    text-align: center;
}

.auth-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-footer a:hover {
    color: var(--auth-link);
}

.auth-footer svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   MESSAGES WOOCOMMERCE
   ============================================ */
.auth-page .woocommerce-message,
.auth-page .woocommerce-error,
.auth-page .woocommerce-info {
    margin: 0 0 16px !important;
    padding: 12px 14px !important;
    border-radius: var(--auth-radius-md) !important;
    font-size: 13px;
}

.auth-page .woocommerce-error {
    background: var(--auth-danger-bg) !important;
    border: 1px solid var(--auth-danger-border) !important;
    color: var(--auth-danger-text) !important;
}

.auth-page .woocommerce-message {
    background: var(--auth-success-bg) !important;
    border: 1px solid var(--auth-success-border) !important;
    color: var(--auth-success-text) !important;
}

.auth-page .woocommerce-info {
    background: var(--auth-info-bg) !important;
    border: 1px solid var(--auth-info-border) !important;
    color: var(--auth-info-text) !important;
}

.auth-form .woocommerce-LostPassword,
.auth-form .woocommerce-form-login__rememberme {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 520px) {
    .auth-page {
        padding: 40px 16px;
        align-items: flex-start;
    }

    .auth-container {
        border-radius: var(--auth-radius-md);
    }

    .auth-header {
        padding: 24px 20px 16px;
    }

    .auth-logo img {
        max-height: 38px;
    }

    .auth-forms {
        padding: 24px 20px;
    }

    .input-wrapper input,
    .btn-primary,
    .social-login .nsl-button {
        height: 42px !important;
    }

    .auth-footer {
        padding: 14px 20px;
    }
}

@media (max-width: 380px) {
    .auth-header,
    .auth-forms,
    .auth-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================
   PAGE MOT DE PASSE OUBLIÉ
   ============================================ */
.lost-password-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 16px auto 0;
    background: var(--auth-primary);
    border-radius: 50%;
}

.lost-password-icon svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

.lost-password-text {
    font-size: 14px;
    color: var(--auth-text-muted);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 20px;
}

body.woocommerce-lost-password .woocommerce-message,
body.woocommerce-lost-password .woocommerce-error,
body.woocommerce-lost-password .woocommerce-info {
    max-width: 440px;
    margin: 0 auto 0 !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    font-size: 14px;
    position: relative;
    top: 40px;
}

body.woocommerce-lost-password .woocommerce-message {
    background: var(--auth-success-bg) !important;
    border: 1px solid var(--auth-success-border) !important;
    color: var(--auth-success-text) !important;
}

body.woocommerce-lost-password .woocommerce-error {
    background: var(--auth-danger-bg) !important;
    border: 1px solid var(--auth-danger-border) !important;
    color: var(--auth-danger-text) !important;
}

body.woocommerce-lost-password .woocommerce-info {
    background: var(--auth-info-bg) !important;
    border: 1px solid var(--auth-info-border) !important;
    color: var(--auth-info-text) !important;
}
