/*
 * My Account login/register page — tab layout, WC form reset, Heateor restyling.
 *
 * Loaded only on /moje-konto/ when the visitor is NOT logged in (gated in
 * inc/auth-page.php). Companion JS in theme/js/auth-tabs.js handles tab toggling.
 *
 * !important policy:
 *  - Own classes (.ms-auth-tabs, .ms-auth-submit, .ms-auth-link, .ms-auth-note,
 *    .ms-auth-consent, .ms-auth-tab, .ms-auth-panel) win specificity via the
 *    `.ms-auth` parent — no !important.
 *  - WC form reset (.woocommerce-form-login/register borders+padding) wins
 *    specificity via `.ms-auth` ancestor over WC's `.woocommerce form.login`
 *    selectors — no !important.
 *  - .input-text styling KEEPS !important: WC's selector is
 *    `.woocommerce form .form-row input.input-text` (0,3,2) which beats any
 *    reasonable `.ms-auth` selector.
 *  - Heateor `.heateor_sl_*` rules KEEP !important: the plugin emits its own
 *    inline `<style>` with `!important` from class-heateor-social-login-public.php
 *    line 2333. Specificity battle is unwinnable without !important.
 */

/* ── Tab layout ── */
.ms-auth {
    max-width: 460px;
    margin: 0 auto;
    padding: 1rem 1rem 0;
}
.ms-auth-tabs {
    display: flex;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.ms-auth-tab {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    font-weight: 400;
    text-align: center;
    background: #fff;
    border: none;
    cursor: pointer;
    color: #525252;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.4;
}
.ms-auth-tab--active {
    font-weight: 600;
    color: #171717;
    background: #f5f5f5;
    position: relative;
}
.ms-auth-tab--active::after {
    content: "\2713";
    margin-left: 0.375rem;
    font-size: 0.8em;
}

/* ── Panels ── */
.ms-auth-panel {
    display: none;
}
.ms-auth-panel--active {
    display: block;
}

/* ── Forms reset (strip default WC borders/padding) ── */
/* `.ms-auth` ancestor (1 class) + WC class (1 class) = 0,2,0 — beats WC's `.woocommerce form.login` (0,1,1). */
.ms-auth .woocommerce-form-login,
.ms-auth .woocommerce-form-register {
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
}

/* ── Form fields ── */
.ms-auth form .form-row {
    margin-bottom: 1rem;
}
.ms-auth .form-row label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}
.ms-auth .input-text {
    width: 100%;
    padding: 0.75rem 1rem !important;
    border: 1px solid #d4d4d4 !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
    transition: border-color 0.15s;
}
.ms-auth .input-text:focus {
    border-color: #BF360C !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(191,54,12,0.1) !important;
}

/* ── Submit button (full-width, brand color) ── */
.ms-auth .ms-auth-submit {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.5rem;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
}
.ms-auth .ms-auth-submit:hover {
    background: #1b5e20;
}

/* ── "Nie pamiętam hasła" link ── */
.ms-auth-link {
    text-align: center;
    margin: 1rem 0 0.5rem;
}
.ms-auth-link a {
    color: #525252;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ms-auth-link a:hover {
    color: #BF360C;
}

/* ── Password auto-generate note ── */
.ms-auth-note {
    font-size: 0.875rem;
    color: #737373;
    margin: -0.25rem 0 1rem;
    line-height: 1.5;
}

/* ── Kill <br> tags WC drops around hooks ── */
.ms-auth .woocommerce-form-login > br,
.ms-auth .woocommerce-form-register > br {
    display: none;
}

/* ── Hide "Remember me" ── */
.ms-auth .woocommerce-form-login__rememberme {
    display: none !important;
}

/* ── Heateor social login → "lub kontynuj z" divider style ── */
/* Plugin emits inline <style> with !important from class-heateor-social-login-public.php:2333 — !important required to override. */
.ms-auth .heateor_sl_outer_login_container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 0.5rem !important;
    padding: 0 !important;
    border: none !important;
    order: 90;
}

/* Replace Heateor title with centered divider line: ─── lub kontynuj z ─── */
.ms-auth .heateor_sl_title {
    display: flex !important;
    align-items: center;
    width: 100%;
    font-family: inherit !important;
    font-size: 0.825rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    color: #a3a3a3 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    float: none !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}
.ms-auth .heateor_sl_title::before,
.ms-auth .heateor_sl_title::after {
    display: none !important;
}
.ms-auth .heateor_sl_outer_login_container::before {
    content: "lub kontynuj z";
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 0.825rem;
    color: #a3a3a3;
    gap: 1rem;
    background: linear-gradient(#d4d4d4, #d4d4d4) left center / calc(50% - 5rem) 1px no-repeat,
                linear-gradient(#d4d4d4, #d4d4d4) right center / calc(50% - 5rem) 1px no-repeat;
    text-align: center;
    justify-content: center;
}

/* Icon row */
.ms-auth .heateor_sl_login_container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    float: none !important;
    width: auto !important;
}
.ms-auth ul.heateor_sl_login_ul {
    display: inline-flex !important;
    align-items: center;
    gap: 0.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.ms-auth ul.heateor_sl_login_ul li {
    float: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Clear-both div Heateor appends */
.ms-auth .heateor_sl_outer_login_container + div[style*="clear:both"] {
    display: none !important;
}

/* ── Loyalty card styling within tabs ── */
.ms-auth .loyalty-reg-card {
    margin: 1.25rem 0;
}

/* ── WC error notices at top ── */
.ms-auth .woocommerce-error,
.ms-auth .woocommerce-message,
.ms-auth .woocommerce-info {
    margin-bottom: 1rem;
}

/* ── Hide WC privacy checkbox (consent is now passive via button click text) ── */
.ms-auth .woocommerce-privacy-policy-text,
.ms-auth .woocommerce-form-register label[for="privacy_policy_reg"],
.ms-auth .woocommerce-form-register .woocommerce-form__label-for-checkbox:has(#privacy_policy_reg) {
    display: none !important;
}

/* ── Passive consent text below button ── */
.ms-auth-consent {
    font-size: 0.8rem;
    color: #737373;
    line-height: 1.6;
    text-align: center;
    margin: 0.75rem 0 0;
}
.ms-auth-consent a {
    color: #525252;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ms-auth-consent a:hover {
    color: #BF360C;
}

/* ── Desktop tweaks ── */
@media (min-width: 768px) {
    .ms-auth {
        padding: 0;
    }
    .ms-auth-tab {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}
