/* =========================================
   WWR AUTH — Styles
   Reuses CSS variables declared in cart.css
   ========================================= */

/* ── PAGE WRAPPER ── */

.wwr-auth-page {
    max-width: 480px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 40px 24px 80px;
    font-family: inherit;
    color: var(--cart-text);
    overflow-x: hidden;
}

/* ── TABS ── */

.wwr-auth-tabs {
    display: flex;
    border-bottom: 2px solid rgba(0,0,0,0.08);
    margin-bottom: 32px;
    gap: 0;
}

.wwr-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--cart-text-light);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-align: center;
}

.wwr-auth-tab:hover {
    color: var(--cart-text);
}

.wwr-auth-tab.active {
    color: var(--cart-green-dark);
    border-bottom-color: var(--cart-green);
}

/* ── PANELS ── */

.wwr-auth-panel {
    display: none;
}

.wwr-auth-panel.active {
    display: block;
}

/* ── FORM FIELDS (supplement cart.css .wwr-field) ── */

.wwr-field-row--inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.wwr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--cart-text);
    cursor: pointer;
}

.wwr-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--cart-green-dark);
    cursor: pointer;
}

.wwr-auth-forgot {
    font-size: 0.85rem;
    color: var(--cart-text-light);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.wwr-auth-forgot:hover {
    color: var(--cart-green-dark);
}

.wwr-field-hint {
    font-size: 0.78rem;
    color: var(--cart-text-light);
}

/* ── INLINE ERROR ── */

.wwr-auth-error {
    color: var(--cart-error);
    font-size: 0.88rem;
    padding: 10px 14px;
    background: rgba(192,57,43,0.07);
    border: 1px solid rgba(192,57,43,0.18);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* ── SUBMIT BUTTON ── */

.wwr-auth-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.wwr-auth-submit.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ── ACCOUNT PANEL (logged-in state) ── */

.wwr-auth-account {
    text-align: center;
    padding: 48px 0;
}

.wwr-auth-account-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cart-green-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.wwr-auth-account h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cart-green-dark);
    margin-bottom: 8px;
}

.wwr-auth-account p {
    color: var(--cart-text-light);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.wwr-auth-account-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── NAV AUTH ICON (desktop pill) ── */

.wwr-auth-login-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #333;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 1px solid rgba(0,0,0,0.1);
    margin-left: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.wwr-auth-login-link:hover {
    color: var(--cart-green-dark);
    background: rgba(0,0,0,0.04);
}

.wwr-auth-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-left: 1px solid rgba(0,0,0,0.1);
    margin-left: 4px;
    padding-left: 10px;
}

.wwr-auth-user-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.wwr-auth-user-link:hover {
    color: var(--cart-green-dark);
    background: rgba(0,0,0,0.04);
}

.wwr-auth-logout-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--cart-text-light);
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.wwr-auth-logout-link:hover {
    color: var(--cart-error);
    background: rgba(192,57,43,0.07);
}

/* ── MOBILE OVERLAY AUTH LINKS ── */

.wwr-mobile-auth-nav {
    border-top: 1px solid rgba(0,0,0,0.07);
    padding-top: 20px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.wwr-mobile-auth-nav .wwr-auth-login-link,
.wwr-mobile-auth-nav .wwr-auth-user-link {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
    padding: 14px 36px;
    border-radius: 14px;
    border: 2px solid rgba(0,0,0,0.08);
    border-left: 2px solid rgba(0,0,0,0.08);
    margin-left: 0;
}

.wwr-mobile-auth-nav .wwr-auth-logout-link {
    font-size: 0.95rem;
    padding: 10px 36px;
    color: var(--cart-text-light);
}

.wwr-mobile-auth-nav .wwr-auth-user {
    flex-direction: column;
    align-items: flex-start;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    gap: 0;
}

/* ── RESPONSIVE ── */

@media (max-width: 768px) {
    .wwr-auth-page {
        padding: 24px 16px 60px;
    }

    /* Prevent iOS Safari from auto-zooming into inputs (requires font-size >= 16px) */
    .wwr-auth-page .wwr-field input,
    .wwr-auth-page .wwr-field select {
        font-size: 16px;
    }

    /* Hide the small inline logout in the desktop nav pill on mobile
       (it's unreachable when .custom-nav is display:none) */
    .custom-nav .wwr-auth-logout-link {
        display: none;
    }

    .wwr-field-row--inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
