.auth-portal {
    --auth-primary: var(--member-primary, #079455);
    --auth-ink: var(--member-accent, #07182d);
    --auth-muted: var(--member-muted, #667085);
    min-height: 100dvh;
    color: var(--auth-ink);
    background:
        radial-gradient(circle at 92% 2%, color-mix(in srgb, var(--auth-primary) 17%, transparent) 0 18rem, transparent 18.1rem),
        radial-gradient(circle at 0 34%, color-mix(in srgb, var(--auth-primary) 11%, transparent) 0 13rem, transparent 13.1rem),
        #f8fcfa;
    overflow-x: hidden;
}

.auth-portal *, .auth-portal *::before, .auth-portal *::after { box-sizing: border-box; }
.auth-portal input { font-size: 16px !important; }
.auth-portal button, .auth-portal a { -webkit-tap-highlight-color: transparent; }

.auth-stage {
    width: min(100%, 78rem);
    min-height: 100dvh;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem);
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(27rem, .78fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.auth-story { position: relative; min-width: 0; padding: 1rem 0; }
.auth-brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.auth-brand-logo {
    width: 4.75rem; height: 4.75rem; flex: 0 0 auto; object-fit: contain;
    padding: .55rem; border-radius: 1.35rem; background: #fff;
    box-shadow: 0 16px 36px rgba(7, 24, 45, .10);
}
.auth-brand-fallback {
    width: 4.75rem; height: 4.75rem; flex: 0 0 auto; display: grid; place-items: center;
    border-radius: 1.35rem; color: var(--member-on-primary, #fff); background: var(--auth-primary);
    box-shadow: 0 16px 36px color-mix(in srgb, var(--auth-primary) 27%, transparent);
}
.auth-brand-name { margin: 0; font-size: clamp(1.55rem, 3vw, 2.45rem); font-weight: 900; line-height: 1.05; letter-spacing: -.045em; overflow-wrap: anywhere; }
.auth-brand-label { margin: .38rem 0 0; color: var(--auth-primary); font-size: .76rem; font-weight: 900; letter-spacing: .34em; text-transform: uppercase; }
.auth-story-copy { position: relative; z-index: 2; margin-top: clamp(2.5rem, 7vh, 5.5rem); }
.auth-story h1 { max-width: 10ch; margin: 0; font-size: clamp(3rem, 6vw, 5.25rem); font-weight: 900; line-height: .98; letter-spacing: -.06em; }
.auth-story-description { max-width: 29rem; margin: 1.5rem 0 0; color: color-mix(in srgb, var(--auth-ink) 76%, #fff); font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 600; line-height: 1.65; }
.auth-dots { display: flex; gap: .75rem; margin-top: 2rem; }
.auth-dots span { width: 2.5rem; height: .48rem; border-radius: 999px; background: color-mix(in srgb, var(--auth-primary) 22%, #fff); }
.auth-dots span:first-child { width: 4rem; background: var(--auth-primary); }

.auth-art {
    position: absolute; z-index: 1; right: -5.5rem; bottom: -2rem; width: min(27vw, 23rem); aspect-ratio: 1;
    border-radius: 50%; overflow: hidden; border: .7rem solid rgba(255,255,255,.75);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--auth-primary) 28%, #eafff2), color-mix(in srgb, var(--auth-primary) 86%, #fff));
    box-shadow: 0 30px 70px color-mix(in srgb, var(--auth-primary) 18%, transparent);
}
.auth-art.has-image { background-image: linear-gradient(180deg, transparent 50%, rgba(3, 82, 45, .22)), var(--auth-hero-image); background-position: center; background-size: cover; }
.auth-art-person { position: absolute; inset: 16%; display: grid; place-items: center; color: rgba(255,255,255,.92); }
.auth-art-person svg { width: 68%; height: 68%; filter: drop-shadow(0 16px 22px rgba(1,52,29,.16)); }
.auth-float-icon { position: absolute; right: -1rem; top: 19%; z-index: 3; width: 5rem; height: 5rem; display: grid; place-items: center; border-radius: 50%; color: var(--auth-primary); background: rgba(255,255,255,.93); box-shadow: 0 18px 40px rgba(7,24,45,.13); }
.auth-float-icon svg { width: 2.5rem; height: 2.5rem; }

.auth-card {
    position: relative; z-index: 5; min-width: 0; padding: clamp(1.4rem, 3vw, 2.5rem);
    border: 1px solid rgba(215, 225, 234, .9); border-radius: 2rem; background: rgba(255,255,255,.94);
    box-shadow: 0 30px 80px rgba(7,24,45,.11); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.auth-card-header h2 { margin: 0; color: var(--auth-ink); font-size: clamp(1.8rem, 3vw, 2.55rem); font-weight: 900; line-height: 1.08; letter-spacing: -.045em; }
.auth-card-header p { margin: .55rem 0 0; color: var(--auth-muted); font-size: 1rem; font-weight: 600; }
.auth-card--login .auth-card-header h2 { font-size: var(--auth-login-title-size, 14px); }
.auth-form { display: grid; gap: 1rem; margin-top: 1.6rem; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.auth-field { min-width: 0; }
.auth-field-label { display: block; margin: 0 0 .45rem; color: color-mix(in srgb, var(--auth-ink) 72%, #fff); font-size: .8rem; font-weight: 800; }
.auth-control {
    min-height: 4.15rem; display: flex; align-items: center; gap: .85rem; padding: .55rem .9rem;
    border: 1.5px solid #d8e1e9; border-radius: 1rem; background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.auth-control:focus-within { border-color: var(--auth-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-primary) 13%, transparent); transform: translateY(-1px); }
.auth-control.is-invalid { border-color: #e11d48; }
.auth-control-icon { flex: 0 0 auto; width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: .75rem; color: var(--auth-primary); background: color-mix(in srgb, var(--auth-primary) 10%, #fff); }
.auth-control-icon svg { width: 1.3rem; height: 1.3rem; }
.auth-input { width: 100%; min-width: 0; padding: 0 !important; border: 0 !important; outline: 0 !important; background: transparent !important; color: var(--auth-ink) !important; box-shadow: none !important; font-weight: 700; }
.auth-input::placeholder { color: #98a2b3 !important; font-weight: 600; }
.auth-toggle { flex: 0 0 auto; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .7rem; color: #8791a5; }
.auth-toggle:hover, .auth-toggle:focus-visible { color: var(--auth-primary); background: color-mix(in srgb, var(--auth-primary) 9%, #fff); outline: none; }
.auth-toggle svg { width: 1.45rem; height: 1.45rem; }
.auth-error { margin: .4rem 0 0; color: #be123c; font-size: .75rem; font-weight: 750; }
.auth-help { margin: .42rem 0 0; color: var(--auth-muted); font-size: .72rem; font-weight: 650; }
.auth-caps-lock { margin: .4rem 0 0; color: #b45309; font-size: .72rem; font-weight: 800; }

.auth-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; padding: .3rem; border: 1px solid #d8e1e9; border-radius: .95rem; background: #f6f8fa; }
.auth-method { min-height: 2.8rem; border-radius: .7rem; color: var(--auth-muted); font-size: .82rem; font-weight: 850; }
.auth-method[aria-selected="true"] { color: var(--auth-primary); background: #fff; box-shadow: 0 5px 16px rgba(7,24,45,.08); }
.auth-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .55rem; }
.auth-strength span { height: .25rem; border-radius: 999px; background: #e5eaf0; transition: background .2s ease; }
.auth-strength[data-score="1"] span:nth-child(-n+1) { background: #e11d48; }
.auth-strength[data-score="2"] span:nth-child(-n+2) { background: #f59e0b; }
.auth-strength[data-score="3"] span:nth-child(-n+3), .auth-strength[data-score="4"] span { background: var(--auth-primary); }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: flex-start; gap: .65rem; color: var(--auth-muted); font-size: .82rem; font-weight: 650; line-height: 1.55; }
.auth-check input { width: 1.2rem; height: 1.2rem; margin-top: .08rem; border-radius: .35rem; color: var(--auth-primary); }
.auth-link { color: var(--auth-primary); font-weight: 850; text-decoration: none; }
.auth-link:hover { text-decoration: underline; text-underline-offset: .18rem; }
.auth-submit { min-height: 3.8rem; display: flex; align-items: center; justify-content: center; gap: .8rem; padding: .8rem 1.1rem; border-radius: 1rem; color: var(--member-on-primary, #fff); background: var(--auth-primary); font-size: 1rem; font-weight: 900; box-shadow: 0 18px 34px color-mix(in srgb, var(--auth-primary) 24%, transparent); transition: transform .18s ease, filter .18s ease; }
.auth-submit:hover { filter: brightness(.94); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0) scale(.995); }
.auth-submit:disabled { opacity: .72; cursor: wait; }
.auth-submit svg { width: 1.45rem; height: 1.45rem; }
.auth-switch { margin-top: 1.35rem; padding: 1rem; border-radius: 1rem; color: var(--auth-muted); background: color-mix(in srgb, var(--auth-primary) 7%, #fff); text-align: center; font-size: .9rem; font-weight: 700; }
.auth-notice { margin-top: 1rem; padding: .8rem 1rem; border: 1px solid #b7e7ce; border-radius: .9rem; color: #075d36; background: #effbf5; font-size: .78rem; font-weight: 700; line-height: 1.55; }
.auth-notice.is-info { border-color: #bae6fd; color: #075985; background: #f0f9ff; }
.auth-fee { padding: .8rem 1rem; border-radius: .9rem; color: #075d36; background: #effbf5; font-size: .8rem; font-weight: 750; }
.auth-back { position: absolute; top: 1rem; left: 1rem; z-index: 8; width: 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: 50%; color: var(--auth-primary); background: rgba(255,255,255,.88); box-shadow: 0 8px 20px rgba(7,24,45,.08); }

.auth-dialog { width: min(34rem, calc(100vw - 2rem)); max-height: 78dvh; padding: 0; border: 0; border-radius: 1.4rem; color: var(--auth-ink); background: #fff; box-shadow: 0 30px 90px rgba(7,24,45,.28); }
.auth-dialog::backdrop { background: rgba(7,24,45,.62); backdrop-filter: blur(5px); }
.auth-dialog-body { padding: 1.5rem; }
.auth-dialog h3 { margin: 0; font-size: 1.35rem; font-weight: 900; }
.auth-dialog p, .auth-dialog li { color: var(--auth-muted); font-size: .88rem; line-height: 1.7; }
.auth-dialog ul { margin: 1rem 0; padding-left: 1.15rem; list-style: disc; }
.auth-dialog-close { width: 100%; min-height: 3rem; margin-top: 1rem; border-radius: .8rem; color: var(--member-on-primary, #fff); background: var(--auth-primary); font-weight: 850; }

@media (min-width: 981px) {
    .auth-stage--login {
        width: min(100%, 92rem);
        grid-template-columns: minmax(0, 1.22fr) minmax(28rem, .78fr);
        gap: clamp(1.5rem, 3vw, 3rem);
        padding: clamp(1.1rem, 2vw, 1.75rem);
    }
    .auth-story--login {
        min-height: calc(100dvh - clamp(2.2rem, 4vw, 3.5rem));
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: clamp(2rem, 4vw, 3.25rem);
        border: 1px solid color-mix(in srgb, var(--auth-primary) 16%, #fff);
        border-radius: 2rem;
        background:
            radial-gradient(circle at 89% 19%, color-mix(in srgb, var(--auth-primary) 28%, transparent) 0 12rem, transparent 12.1rem),
            radial-gradient(circle at 72% 92%, color-mix(in srgb, var(--auth-primary) 20%, transparent) 0 17rem, transparent 17.1rem),
            linear-gradient(145deg, #f8fff9 0%, color-mix(in srgb, var(--auth-primary) 9%, #fff) 100%);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 28px 70px rgba(7,24,45,.08);
    }
    .auth-story--login::before {
        content: '';
        position: absolute;
        top: -8rem;
        right: 8%;
        width: 22rem;
        height: 22rem;
        border: 4rem solid color-mix(in srgb, var(--auth-primary) 7%, transparent);
        border-radius: 50%;
        pointer-events: none;
    }
    .auth-story--login .auth-brand { position: relative; z-index: 4; }
    .auth-story--login .auth-story-copy { z-index: 4; max-width: 33rem; margin-top: clamp(3.25rem, 8vh, 6.25rem); }
    .auth-story--login h1 { max-width: 8.5ch; font-size: var(--auth-login-hero-size, 56px); }
    .auth-story--login .auth-story-description { max-width: 25rem; font-size: clamp(.98rem, 1.4vw, 1.18rem); }
    .auth-story--login .auth-art { right: clamp(1.25rem, 3vw, 3.2rem); bottom: 5.8rem; width: min(27vw, 23.5rem); border-width: .6rem; }
    .auth-story--login .auth-float-icon { right: clamp(1.4rem, 2.5vw, 2.8rem); top: 19%; width: 4.3rem; height: 4.3rem; }
    .auth-card--login { width: min(100%, 32rem); justify-self: center; padding: clamp(2rem, 3vw, 2.7rem); }
    .auth-card--login .auth-card-header h2 { letter-spacing: -.01em; }
    .auth-card--login .auth-form { gap: 1.15rem; margin-top: 1.8rem; }
    .auth-card--login .auth-control { min-height: 4.35rem; }
}

@media (max-width: 980px) {
    .auth-stage { width: min(100%, 40rem); grid-template-columns: 1fr; align-content: start; gap: 1.25rem; padding: 1rem 1rem 2rem; }
    .auth-story { padding: 1rem .25rem 0; }
    .auth-story-copy { margin-top: 2rem; }
    .auth-story h1 { max-width: 12ch; font-size: clamp(2.4rem, 10vw, 4rem); }
    .auth-story-description { margin-top: 1rem; font-size: 1rem; line-height: 1.55; }
    .auth-art { right: -1rem; bottom: -1rem; width: 12rem; opacity: .78; }
    .auth-float-icon { display: none; }
    .auth-card { border-radius: 1.5rem; }
}

@media (max-width: 620px) {
    .auth-stage { padding: max(.7rem, env(safe-area-inset-top)) .7rem calc(1.25rem + env(safe-area-inset-bottom)); }
    .auth-story { padding: .75rem .55rem 0; }
    .auth-brand-logo, .auth-brand-fallback { width: 3.5rem; height: 3.5rem; border-radius: 1rem; }
    .auth-brand-name { font-size: 1.22rem; letter-spacing: -.025em; }
    .auth-brand-label { font-size: .54rem; letter-spacing: .22em; }
    .auth-story-copy { margin-top: 1.15rem; padding-right: 5rem; }
    .auth-story h1 { font-size: 1.85rem; line-height: 1.04; }
    .auth-story-description { margin-top: .65rem; font-size: .78rem; line-height: 1.48; }
    .auth-dots { margin-top: 1.15rem; }
    .auth-dots span { height: .35rem; width: 1.65rem; }
    .auth-dots span:first-child { width: 2.7rem; }
    .auth-art { width: 8rem; right: -.45rem; bottom: -.1rem; border-width: .35rem; }
    .auth-card { padding: 1.05rem; border-radius: 1.2rem; }
    .auth-card-header h2 { font-size: 1.4rem; }
    .auth-card-header p { margin-top: .35rem; font-size: .78rem; }
    .auth-grid { grid-template-columns: 1fr; }
    .auth-control { min-height: 3.45rem; border-radius: .82rem; padding: .45rem .72rem; gap: .65rem; }
    .auth-control-icon { width: 2rem; height: 2rem; border-radius: .62rem; }
    .auth-control-icon svg { width: 1.1rem; height: 1.1rem; }
    .auth-field-label { margin-bottom: .3rem; font-size: .7rem; }
    .auth-form { gap: .75rem; margin-top: 1rem; }
    .auth-check, .auth-help, .auth-error { font-size: .7rem; }
    .auth-link { font-size: .76rem; }
    .auth-submit { min-height: 3.35rem; border-radius: .82rem; font-size: .88rem; }
    .auth-switch { margin-top: 1rem; padding: .82rem; font-size: .76rem; }
    .auth-notice, .auth-fee { font-size: .7rem; }
    .auth-method { min-height: 2.55rem; font-size: .72rem; }
    .auth-row { align-items: flex-start; }
}

@media (max-width: 380px) {
    .auth-story-description { max-width: 17rem; }
    .auth-art { width: 6.7rem; }
    .auth-card { padding: .9rem; }
}

@media (prefers-reduced-motion: no-preference) {
    .auth-story { animation: auth-rise .55s cubic-bezier(.2,.75,.25,1) both; }
    .auth-card { animation: auth-rise .65s .08s cubic-bezier(.2,.75,.25,1) both; }
    .auth-art { animation: auth-float 5s ease-in-out infinite; }
    @keyframes auth-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
    @keyframes auth-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
}

@media (prefers-reduced-motion: reduce) {
    .auth-control, .auth-submit { transition: none; }
}
