/* =========================================
   ShastaRobux Sign In / Sign Up card
   Page: My Account when logged out (woocommerce/myaccount/form-login.php)
   Local preview: login.html in the project root (npm run dev)
   ========================================= */

.srx-auth {
    --srx-card: #1e2329;
    --srx-field: #111827;
    --srx-border: rgba(255, 255, 255, 0.1);
    --srx-muted: #9ca3af;
    --srx-purple: #a855f7;
    --srx-purple-light: #c084fc;
    --srx-speed: 0.5s;
    --srx-ease: cubic-bezier(0.65, 0, 0.35, 1);

    position: relative;
    isolation: isolate;
    flex: 1 1 100%;
    width: 100%;
    max-width: 62rem;
    margin: 0 auto;
    font-family: 'Montserrat', sans-serif;
    color: #fff;
}

/* Soft purple/blue glow behind the card */
.srx-auth::before {
    content: "";
    position: absolute;
    inset: 15% 5% 0;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.22), transparent 55%),
        radial-gradient(circle at 80% 40%, rgba(59, 130, 246, 0.16), transparent 55%);
    filter: blur(60px);
    pointer-events: none;
}

/* style.css spaces the logged-in My Account layout for its sidebar; tighten it here */
.woocommerce-account .woocommerce {
    margin-top: 0.5rem;
    padding-top: 0;
}

.woocommerce-account .woocommerce > .woocommerce-notices-wrapper {
    flex: 1 1 100%;
    max-width: 62rem;
    margin-inline: auto;
}

.woocommerce-account .woocommerce > .woocommerce-notices-wrapper:empty {
    display: none;
}

.woocommerce-account .woocommerce-notices-wrapper > * {
    margin-bottom: 0;
}

/* ---------- Heading above the card ---------- */
.srx-auth-intro {
    margin-bottom: 1.25rem;
    text-align: center;
}

.srx-auth-title {
    margin: 0 0 0.35rem;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.srx-auth-subtitle {
    max-width: 40rem;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--srx-muted);
}

/* ---------- Sign In / Sign Up switch (phones & small tablets) ---------- */
.srx-auth-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 22rem;
    margin: 0 auto 1.25rem;
    padding: 0.35rem;
    background: var(--srx-card);
    border: 1px solid var(--srx-border);
    border-radius: 999px;
}

.srx-auth-tab {
    position: relative;
    z-index: 1;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: var(--srx-muted);
    transition: color 0.3s;
}

.srx-auth-tab:hover,
.srx-auth-tab[aria-selected="true"] {
    color: #fff;
    text-decoration: none;
}

.srx-auth-tabs-indicator {
    position: absolute;
    top: 0.35rem;
    bottom: 0.35rem;
    left: 0.35rem;
    width: calc(50% - 0.35rem);
    border-radius: 999px;
    background: linear-gradient(to right, #9333ea, #a855f7);
    box-shadow: 0 8px 20px -8px rgba(168, 85, 247, 0.7);
    transition: transform 0.45s var(--srx-ease);
}

.is-register .srx-auth-tabs-indicator {
    transform: translateX(100%);
}

/* ---------- Card ---------- */
.srx-auth-card {
    position: relative;
    display: grid;
    overflow: hidden;
    background: var(--srx-card);
    border: 1px solid var(--srx-border);
    border-radius: 1.5rem;
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.6);
}

/* Phones: both forms share one spot and slide past each other */
.srx-auth-panel {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    padding: 1.75rem 1.25rem;
    background: var(--srx-card);
}

.srx-auth-panel--register,
.is-register .srx-auth-panel--login {
    opacity: 0;
    visibility: hidden;
}

.srx-auth-panel--register {
    transform: translateX(15%);
}

.is-register .srx-auth-panel--login {
    transform: translateX(-15%);
}

.is-register .srx-auth-panel--register {
    opacity: 1;
    visibility: visible;
    transform: none;
}

@media (max-width: 899.98px) {
    /* The old form fades out first, then the new one fades in as it slides into place */
    .srx-auth-panel {
        transition:
            transform var(--srx-speed) var(--srx-ease),
            opacity calc(var(--srx-speed) * 0.4) ease,
            visibility var(--srx-speed);
    }

    .srx-auth:not(.is-register) .srx-auth-panel--login,
    .is-register .srx-auth-panel--register {
        transition-duration: var(--srx-speed), calc(var(--srx-speed) * 0.6), var(--srx-speed);
        transition-delay: 0s, calc(var(--srx-speed) * 0.25), 0s;
    }
}

.srx-auth-overlay-wrap {
    display: none;
}

/* ---------- Forms ---------- */
.srx-auth-form {
    width: 100%;
    max-width: 23rem;
    margin: 0 auto;
}

.srx-auth-heading {
    margin: 0 0 1.1rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: #fff;
}

/* Google button (Nextend Social Login plugin): full width, same corners as the fields */
.srx-auth-social div.nsl-container.nsl-container-block .nsl-container-buttons {
    display: flex;
    padding: 0;
}

.srx-auth-social div.nsl-container-block .nsl-container-buttons a {
    margin: 0;
}

.srx-auth-social .nsl-button-google-modern {
    margin-top: 0;
    padding: 12px 16px;
    border-radius: 0.75rem;
    line-height: 1.3;
}

.srx-auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--srx-muted);
}

.srx-auth-divider::before,
.srx-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--srx-border);
}

.srx-auth-field {
    margin-bottom: 0.85rem;
}

.srx-auth .srx-auth-label {
    display: block;
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
}

.srx-auth-label .required {
    color: #f87171;
    text-decoration: none;
    border: 0;
}

.srx-auth-input-wrap {
    position: relative;
}

.srx-auth-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.srx-auth-input-wrap > .srx-auth-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    color: #6b7280;
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 0.2s;
}

.srx-auth-input-wrap:focus-within > .srx-auth-icon {
    color: var(--srx-purple);
}

.srx-auth .srx-auth-input {
    width: 100%;
    height: 2.9rem;
    padding: 0 1rem 0 2.85rem;
    background: var(--srx-field);
    border: 1px solid var(--srx-border);
    border-radius: 0.75rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.srx-auth .srx-auth-input--password {
    padding-right: 3rem;
}

.srx-auth .srx-auth-input::placeholder {
    color: #4b5563;
}

.srx-auth .srx-auth-input:focus {
    background: #0b1120;
    border-color: var(--srx-purple);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18);
}

.srx-auth .srx-auth-input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    box-shadow: 0 0 0 100px var(--srx-field) inset;
    caret-color: #fff;
}

.srx-auth .srx-auth-eye {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #6b7280;
    transform: translateY(-50%);
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
}

.srx-auth .srx-auth-eye:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.srx-auth-eye .srx-auth-icon--hide,
.srx-auth-eye.is-visible .srx-auth-icon--show {
    display: none;
}

.srx-auth-eye.is-visible .srx-auth-icon--hide {
    display: block;
}

.srx-auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0.15rem 0 1.1rem;
}

.srx-auth .srx-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--srx-muted);
    cursor: pointer;
}

.srx-auth-check input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--srx-purple);
    cursor: pointer;
}

.srx-auth-link,
.srx-auth-switch a {
    font-weight: 700;
    text-decoration: none;
    color: var(--srx-purple-light);
    transition: color 0.2s;
}

.srx-auth-link {
    font-size: 0.875rem;
}

.srx-auth-link:hover,
.srx-auth-switch a:hover {
    color: #d8b4fe;
    text-decoration: underline;
}

.srx-auth-note {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #bfdbfe;
}

.srx-auth .woocommerce-privacy-policy-text {
    margin-bottom: 1rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #6b7280;
}

.srx-auth .woocommerce-privacy-policy-text:empty {
    display: none;
}

.srx-auth .woocommerce-privacy-policy-text a {
    color: var(--srx-purple-light);
}

.srx-auth .srx-auth-submit {
    width: 100%;
    height: 2.9rem;
    border: 0;
    border-radius: 0.75rem;
    background: linear-gradient(to right, #9333ea, #a855f7);
    box-shadow: 0 10px 25px -8px rgba(168, 85, 247, 0.55);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.srx-auth .srx-auth-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 16px 30px -10px rgba(168, 85, 247, 0.7);
    transform: translateY(-2px);
}

.srx-auth .srx-auth-submit:active {
    transform: translateY(0);
}

.srx-auth-switch {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    text-align: center;
    color: var(--srx-muted);
}

/* ---------- Sliding cover content ---------- */
.srx-auth-logo {
    display: block;
    width: 7rem;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 1rem;
}

.srx-auth-overlay-title {
    margin: 0 0 0.75rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
}

.srx-auth-overlay-text {
    max-width: 20rem;
    margin: 0 0 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.srx-auth .srx-auth-ghost {
    display: inline-block;
    padding: 0.85rem 2.75rem;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.25s, color 0.25s, transform 0.25s;
}

.srx-auth .srx-auth-ghost:hover {
    background-color: #fff;
    color: #6b21a8;
    transform: translateY(-2px);
}

/* ---------- Keyboard focus ---------- */
.srx-auth a:focus-visible,
.srx-auth button:focus-visible,
.srx-auth input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--srx-purple-light);
    outline-offset: 3px;
}

.srx-auth .srx-auth-ghost:focus-visible {
    outline-color: #fff;
}

/* ---------- Tablets & desktop: sliding cover ---------- */
@media (min-width: 900px) {
    /* Keep the whole card on screen below the site header; centred on taller screens */
    .srx-auth {
        --srx-speed: 0.7s;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100vh - 9rem);
        min-height: calc(100svh - 9rem);
    }

    .srx-auth-tabs,
    .srx-auth-switch {
        display: none;
    }

    .srx-auth-card {
        grid-template-columns: 1fr 1fr;
    }

    /* Both forms slide across; the one on top swaps at the halfway point, while the cover hides them */
    .srx-auth-panel {
        padding: clamp(1.75rem, 5vh, 3rem) 3rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition:
            transform var(--srx-speed) var(--srx-ease),
            opacity 0s linear calc(var(--srx-speed) / 2),
            z-index 0s linear calc(var(--srx-speed) / 2);
    }

    .srx-auth-panel--login {
        z-index: 2;
    }

    .srx-auth-panel--register {
        z-index: 1;
        opacity: 0;
    }

    .is-register .srx-auth-panel--login {
        opacity: 1;
        visibility: visible;
        transform: translateX(100%);
    }

    .is-register .srx-auth-panel--register {
        z-index: 5;
        opacity: 1;
        transform: translateX(100%);
    }

    /* The new form's content rises in as the cover moves off it */
    .srx-auth:not(.is-register) .srx-auth-panel--login .srx-auth-form,
    .is-register .srx-auth-panel--register .srx-auth-form {
        animation: srx-auth-rise 0.45s var(--srx-ease) 0.3s both;
    }

    .srx-auth-overlay-wrap {
        position: absolute;
        top: 0;
        left: 50%;
        z-index: 100;
        display: block;
        width: 50%;
        height: 100%;
        overflow: hidden;
        transition: transform var(--srx-speed) var(--srx-ease);
    }

    .is-register .srx-auth-overlay-wrap {
        transform: translateX(-100%);
    }

    /* Twice as wide as its window, so it can slide the other way for a parallax feel */
    .srx-auth-overlay {
        position: relative;
        left: -100%;
        width: 200%;
        height: 100%;
        background-color: #7e22ce;
        background-image:
            radial-gradient(rgba(255, 255, 255, 0.07) 15%, transparent 16%),
            radial-gradient(rgba(255, 255, 255, 0.07) 15%, transparent 16%),
            radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.2), transparent 45%),
            linear-gradient(135deg, #a855f7 0%, #7e22ce 45%, #4c1d95 100%);
        background-position: 0 0, 15px 15px, 0 0, 0 0;
        background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100%;
        transition: transform var(--srx-speed) var(--srx-ease);
    }

    .is-register .srx-auth-overlay {
        transform: translateX(50%);
    }

    .srx-auth-overlay-panel {
        position: absolute;
        top: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 50%;
        height: 100%;
        padding: 0 3rem;
        text-align: center;
        transition: transform var(--srx-speed) var(--srx-ease);
    }

    .srx-auth-overlay-panel--left {
        left: 0;
        transform: translateX(-20%);
    }

    .is-register .srx-auth-overlay-panel--left {
        transform: translateX(0);
    }

    .srx-auth-overlay-panel--right {
        right: 0;
        transform: translateX(0);
    }

    .is-register .srx-auth-overlay-panel--right {
        transform: translateX(20%);
    }

    /* Registration turned off in WooCommerce: just the sign-in form */
    .is-login-only .srx-auth-card {
        grid-template-columns: 1fr;
        max-width: 30rem;
        min-height: 0;
        margin-inline: auto;
    }
}

/* Short desktop screens: drop the heading so the card still fits without scrolling */
@media (min-width: 900px) and (max-height: 700px) {
    .srx-auth-intro {
        display: none;
    }
}

/* No sliding on page load (auth.js adds .is-ready after the first paint) */
.srx-auth:not(.is-ready) .srx-auth-panel,
.srx-auth:not(.is-ready) .srx-auth-overlay-wrap,
.srx-auth:not(.is-ready) .srx-auth-overlay,
.srx-auth:not(.is-ready) .srx-auth-overlay-panel,
.srx-auth:not(.is-ready) .srx-auth-tabs-indicator {
    transition: none;
    animation: none;
}

@keyframes srx-auth-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .srx-auth *,
    .srx-auth *::before,
    .srx-auth *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
    }
}
