/*
 * Auth shell styles - templates/login.php + templates/register.php
 *
 * Two-column layout: form panel on the left, decorative aside on the
 * right. Login shows a sample change-detected card; register shows a
 * "what you get on day 1" benefit list. Both panels inherit the
 * editorial tokens from style.css (--clrInk, --clrPrimary, etc.) and
 * use camelCase class names to stay consistent with homepage.css.
 */

/* ──────────────────────────────────────────────
   Shell
   ────────────────────────────────────────────── */

.authShell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    max-width: 1200px;
    margin: clamp(1.5rem, 4vw, 3rem) auto clamp(3rem, 6vw, 5rem);
    padding: 0 clamp(1.25rem, 4vw, 3rem);
    align-items: stretch;
}

.authPanel,
.authAside {
    display: flex;
    min-width: 0;
}

.authPanelInner,
.authAsideInner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ──────────────────────────────────────────────
   Form panel
   ────────────────────────────────────────────── */

.authPanel {
    background: var(--clrSurface);
    border: 1px solid var(--clrBorder);
    border-radius: var(--radiusXl);
    box-shadow: var(--shadowCard);
    padding: clamp(2rem, 4vw, 3.25rem);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.authPanel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 50% at 100% 0%, rgba(79, 70, 229, 0.08), transparent 60%),
        radial-gradient(ellipse 55% 50% at 0% 100%, rgba(249, 115, 22, 0.06), transparent 60%);
    pointer-events: none;
}

.authBrand {
    margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.authHeader {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.authEyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--clrMuted);
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}
.authEyebrow::before {
    content: "";
    width: 32px;
    height: 1px;
    background: currentColor;
}

.authTitle {
    font-size: clamp(1.7rem, 3.3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.032em;
    line-height: 1.08;
    max-width: 20ch;
}

.authLead {
    font-size: 1.02rem;
    color: var(--clrInk70);
    line-height: 1.55;
    max-width: 42ch;
}

/* ──────────────────────────────────────────────
   Alert
   ────────────────────────────────────────────── */

.authAlert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    background: var(--clrAccentSoft);
    color: var(--clrAccentDark);
    border: 1px solid rgba(234, 88, 12, 0.2);
    border-radius: var(--radiusMd);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 1.5rem;
}
.authAlert svg { flex: none; margin-top: 1px; }

/* ──────────────────────────────────────────────
   Form
   ────────────────────────────────────────────── */

.authForm {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* .formField, .fieldLabel, .fieldLabelRow, .fieldHelper and .fieldInput
   live in style.css so they work on every page. */

/* ──────────────────────────────────────────────
   Password field
   ────────────────────────────────────────────── */

.passwordWrap {
    position: relative;
}
.passwordWrap .fieldInput {
    padding-right: 3rem;
}
.passwordToggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: var(--radiusSm);
    color: var(--clrInk70);
    cursor: pointer;
    transition: background 200ms var(--ease), color 200ms var(--ease);
}
.passwordToggle:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--clrInk);
}
.passwordToggle:focus-visible {
    outline: 2px solid var(--clrPrimary);
    outline-offset: 2px;
}
.passwordToggle .iconEyeOff { display: none; }
.passwordToggle.isRevealed .iconEye { display: none; }
.passwordToggle.isRevealed .iconEyeOff { display: block; }

/* ──────────────────────────────────────────────
   Remember me checkbox
   ────────────────────────────────────────────── */

.rememberMe {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: var(--clrInk70);
    cursor: pointer;
    user-select: none;
    padding: 0.25rem 0;
    margin-top: -0.25rem;
}
.rememberMe input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.rememberMeBox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--clrBorderStrong);
    background: var(--clrSurface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease);
    flex: none;
}
.rememberMe:hover .rememberMeBox {
    border-color: var(--clrPrimary);
}
.rememberMe input:focus-visible + .rememberMeBox {
    outline: 2px solid var(--clrPrimary);
    outline-offset: 2px;
}
.rememberMe input:checked + .rememberMeBox {
    background: var(--clrPrimary);
    border-color: var(--clrPrimary);
    color: #fff;
}
.rememberMeLabel { letter-spacing: -0.005em; }

/* ──────────────────────────────────────────────
   Auth footer (register link)
   ────────────────────────────────────────────── */

.authFooter {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--clrBorder);
    font-size: 0.92rem;
    color: var(--clrInk70);
}
.authFooterLink {
    color: var(--clrPrimary);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: color 200ms var(--ease);
}
.authFooterLink:hover {
    color: var(--clrPrimaryDark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ──────────────────────────────────────────────
   Decorative aside - example change card
   ────────────────────────────────────────────── */

.authAside {
    background: var(--clrInk);
    color: #fff;
    border-radius: var(--radiusXl);
    padding: clamp(2rem, 4vw, 3.25rem);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.authAside::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 55% 45% at 90% 10%, rgba(249, 115, 22, 0.32), transparent 55%),
        radial-gradient(ellipse 55% 60% at 10% 100%, rgba(79, 70, 229, 0.38), transparent 55%);
}
.authAside::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse at center, black, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 75%);
    pointer-events: none;
}

.authAsideInner {
    gap: 1.5rem;
    justify-content: space-between;
}

.asideEyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem 0.45rem 0.75rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radiusPill);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.82);
    align-self: flex-start;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ──────────────────────────────────────────────
   Change card (decorative preview)
   ────────────────────────────────────────────── */

.changeCard {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radiusLg);
    padding: 1.5rem 1.75rem 1.65rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.5);
}

.changeCardHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.changeCardHead time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.changeSeverity {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.35rem 0.7rem 0.35rem 0.55rem;
    border-radius: var(--radiusPill);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
}
.severityDot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.changeSeverityCritical {
    color: var(--clrAccent);
    background: rgba(249, 115, 22, 0.14);
}

.changeTitle {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: #fff;
    max-width: 30ch;
}

.changePath {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    padding-top: 0.1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.changeDiff {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.82rem;
}
.diffRow {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    line-height: 1.45;
}
.diffMark {
    font-weight: 700;
    flex: none;
    width: 14px;
    text-align: center;
}
.diffRowRemoved {
    background: rgba(239, 68, 68, 0.09);
    color: rgba(254, 202, 202, 0.92);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.diffRowAdded {
    background: rgba(16, 185, 129, 0.1);
    color: rgba(167, 243, 208, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.changeInsight {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.insightLabel {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--clrAccent);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.insightLabel::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
}
.insightBody {
    font-size: 0.91rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
    max-width: 42ch;
}

.asideMeta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    padding-top: 0.25rem;
}

/* ──────────────────────────────────────────────
   Motion on load
   ────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
    .authPanel > .authPanelInner > * {
        opacity: 0;
        transform: translateY(10px);
        animation: authRise 700ms var(--ease) forwards;
    }
    .authPanelInner .authBrand    { animation-delay: 40ms; }
    .authPanelInner .authHeader   { animation-delay: 140ms; }
    .authPanelInner .authAlert    { animation-delay: 200ms; }
    .authPanelInner .authForm     { animation-delay: 240ms; }
    .authPanelInner .authFooter   { animation-delay: 360ms; }

    .authAsideInner > * {
        opacity: 0;
        transform: translateY(12px);
        animation: authRise 900ms var(--ease) forwards;
    }
    .authAsideInner > :nth-child(1) { animation-delay: 220ms; }
    .authAsideInner > :nth-child(2) { animation-delay: 320ms; }
    .authAsideInner > :nth-child(3) { animation-delay: 440ms; }
}
@keyframes authRise {
    to { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

@media (max-width: 960px) {
    .authShell {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .authAside {
        order: -1;
        padding: 1.75rem;
    }
    .authAsideInner { gap: 1.1rem; }
    .changeCard { padding: 1.25rem 1.35rem; }
}

@media (max-width: 520px) {
    .authPanel { padding: 1.75rem 1.35rem 1.5rem; }
    .authBrand { margin-bottom: 1.5rem; }
    .authTitle { font-size: 1.55rem; }
    .authLead { font-size: 0.96rem; }
    .authAside { display: none; }
    .authShell { margin-bottom: 2rem; }
}

/* .fieldRow and .fieldHint live in style.css (global form primitives). */

.authFinePrint {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--clrMuted);
    line-height: 1.55;
    text-align: center;
    max-width: 44ch;
    margin-inline: auto;
}
.authFinePrint a {
    color: var(--clrInk70);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.authFinePrint a:hover {
    color: var(--clrPrimary);
}

/* ──────────────────────────────────────────────
   Register aside - benefit list
   ────────────────────────────────────────────── */

.benefitList {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.benefitItem {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 1rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}
.benefitItem:last-child {
    border-bottom: 0;
}

.benefitIcon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(79, 70, 229, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: none;
}
.benefitItem:nth-child(2) .benefitIcon {
    background: rgba(249, 115, 22, 0.22);
    color: var(--clrAccent);
}
.benefitItem:nth-child(3) .benefitIcon {
    background: rgba(16, 185, 129, 0.18);
    color: #10B981;
}
.benefitItem:nth-child(4) .benefitIcon {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
}

.benefitItem h3 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.012em;
    color: #fff;
    margin-bottom: 0.2rem;
}
.benefitItem p {
    font-size: 0.83rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
    max-width: 38ch;
}

@media (max-width: 520px) {
    .fieldRow {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ──────────────────────────────────────────────
   WooCommerce notices when they render above the auth shell
   (logged-out /my-account/ prints notices outside our container)
   ────────────────────────────────────────────── */

body.woocommerce-account .woocommerce-notices-wrapper {
    max-width: 1200px;
    margin: clamp(1.5rem, 4vw, 3rem) auto 0;
    padding: 0 clamp(1.25rem, 4vw, 3rem);
}
body.woocommerce-account .woocommerce-notices-wrapper + .authShell {
    margin-top: 1rem;
}
body.woocommerce-account .woocommerce-error,
body.woocommerce-account .woocommerce-info,
body.woocommerce-account .woocommerce-message {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radiusMd);
    font-size: 0.92rem;
    line-height: 1.5;
    list-style: none;
    margin: 0 0 0.75rem;
    border: 1px solid var(--clrBorder);
    background: var(--clrSurface);
    color: var(--clrInk);
    box-shadow: var(--shadowCard);
}
body.woocommerce-account .woocommerce-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.22);
    color: #B91C1C;
}
body.woocommerce-account .woocommerce-message {
    background: rgba(16, 185, 129, 0.09);
    border-color: rgba(16, 185, 129, 0.22);
    color: #047857;
}
body.woocommerce-account .woocommerce-info {
    background: var(--clrPrimarySoft);
    border-color: rgba(79, 70, 229, 0.18);
    color: var(--clrPrimaryDark);
}
body.woocommerce-account .woocommerce-error li,
body.woocommerce-account .woocommerce-info li,
body.woocommerce-account .woocommerce-message li {
    list-style: none;
}

/* ──────────────────────────────────────────────
   Plan notice on register page (?plan=starter)
   ────────────────────────────────────────────── */

.authPlanNotice {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    background: var(--clrPrimarySoft);
    color: var(--clrPrimaryDark);
    border: 1px solid rgba(79, 70, 229, 0.18);
    border-radius: var(--radiusMd);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 1rem;
}

/* ──────────────────────────────────────────────
   Magic-link sign-in (email me a login link)
   ────────────────────────────────────────────── */
.authDivider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1.25rem;
    color: var(--clrMuted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.authDivider::before,
.authDivider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--clrBorder, rgba(17, 24, 39, 0.12));
}
.authMagicForm { margin-top: 0; }
.authMagicMessage {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radiusMd);
}
.authMagicSuccess {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
}
.authMagicError {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fca5a5;
}
.ghostButtonFull { width: 100%; }

/* ──────────────────────────────────────────────
   Welcome page (/welcome/) - post-checkout landing.
   Full-bleed <section> with vertical padding; an inner
   <div class="welcomeContent"> caps reading width.
   ────────────────────────────────────────────── */
.welcomeSection {
    width: 100%;
    padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem);
    background: var(--clrPaperSoft, #F4F3FB);
    box-sizing: border-box;
}
.welcomeContent {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.welcomeBrand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    justify-content: center;
    margin-bottom: 1.1rem;
    text-decoration: none;
    color: var(--clrInk, #0F172A);
    font-weight: 700;
}

.welcomeSuccessIcon {
    width: 72px;
    height: 72px;
    margin: 0.75rem auto 1.25rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 100%);
    color: #047857;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.08);
}

.welcomeHeader { margin-bottom: 1.75rem; }
.welcomeEyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--clrPrimary, #4F46E5);
    margin: 0 0 0.5rem;
}
.welcomeTitle {
    max-width: 24ch;
    margin: 0 auto 0.75rem;
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--clrInk, #0F172A);
}
.welcomeLead {
    max-width: 52ch;
    margin: 0 auto;
    color: var(--clrInk70, rgba(15, 23, 42, 0.72));
    font-size: 1rem;
    line-height: 1.55;
}

.welcomeSteps {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
    display: grid;
    gap: 0.85rem;
    text-align: left;
}
.welcomeSteps li {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    background: var(--clrSurface, #fff);
    border-radius: var(--radiusMd, 12px);
    border: 1px solid var(--clrBorder, rgba(15, 23, 42, 0.08));
}
.welcomeStepIndex {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: var(--clrInk, #0F172A);
    color: #fff;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.welcomeSteps strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--clrInk, #0F172A);
    margin-bottom: 2px;
}
.welcomeSteps span {
    font-size: 0.88rem;
    color: var(--clrMuted, #64748B);
    line-height: 1.5;
}

.welcomeFooter { margin: 0; }
.welcomeFooter p { margin: 0.35rem 0; font-size: 0.95rem; color: var(--clrInk70, rgba(15, 23, 42, 0.72)); }
.welcomeFooterLink {
    color: var(--clrPrimary, #4F46E5);
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.25rem;
}
.welcomeFooterLink:hover { text-decoration: underline; text-underline-offset: 3px; }
.welcomeSupportLine {
    margin-top: 0.75rem !important;
    font-size: 0.85rem;
    color: var(--clrMuted, #64748B) !important;
}
.welcomeSupportLine a {
    color: var(--clrPrimary, #4F46E5);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 520px) {
    .welcomeSection { padding: 3rem 1rem; }
    .welcomeSteps li { padding: 0.85rem 0.95rem; }
    .welcomeSuccessIcon { width: 60px; height: 60px; }
    .welcomeSuccessIcon svg { width: 36px; height: 36px; }
}
