/* ── Login / register redesign ─────────────────────────────
   Shared design tokens with brand.css. Split layout: brand
   aside (desktop) + form panel. Orbital visual in the aside. */

/* Aliases for tokens brand.css does not define, so every
   var() below resolves instead of falling back to nothing. */
:root {
    --text: var(--ink-2);
    --faint: #94a3b8;
    --line-2: #d8d2c7;
}

.auth-shell {
    width: min(1080px, 100%);
    margin: auto;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 640px;
    animation: shell-in .6s cubic-bezier(.22,.8,.32,1) both;
}
@keyframes shell-in {
    from { opacity: 0; transform: translateY(14px) scale(.995); }
    to { opacity: 1; transform: none; }
}

/* ---------- Left brand panel ---------- */
.auth-aside {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(155deg, #0d0d12 0%, #4f46e5 55%, #6c63ff 100%);
}
/* Single soft vignette — orbit system carries the motion */
.auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(120% 90% at 80% 0%, rgba(255,255,255,.14), transparent 50%);
    pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }

/* Orbital visual — center mark + rotating rings + floating chips */
.orbit-stage {
    position: relative;
    width: 300px; height: 300px;
    margin: 30px auto 0;
}
.orbit {
    position: absolute;
    top: 50%; left: 50%;
    width: 100px; height: 100px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
}
.orbit-a { width: 190px; height: 190px; animation: orbit-spin 18s linear infinite; }
.orbit-b { width: 270px; height: 270px; animation: orbit-spin-rev 28s linear infinite; border-style: dashed; opacity: .7; }
@keyframes orbit-spin {
    from { transform: translate(-50%,-50%) rotate(0deg); }
    to { transform: translate(-50%,-50%) rotate(360deg); }
}
@keyframes orbit-spin-rev {
    from { transform: translate(-50%,-50%) rotate(360deg); }
    to { transform: translate(-50%,-50%) rotate(0deg); }
}
.sat {
    position: absolute;
    top: -15px; left: 50%;
    width: 30px; height: 30px;
    margin-left: -15px;
    display: grid; place-items: center;
    background: #fff; color: #4f46e5;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.orbit-a .sat { animation: sat-spin 18s linear infinite reverse; }
.orbit-b .sat { animation: sat-spin 28s linear infinite; }
@keyframes sat-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sat svg { width: 14px; height: 14px; }
.sat-2 { top: auto; bottom: -15px; }
.orbit-core {
    position: absolute;
    top: 50%; left: 50%;
    width: 76px; height: 76px;
    transform: translate(-50%,-50%);
    display: grid; place-items: center;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 22px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 16px 40px rgba(0,0,0,.35), 0 0 0 18px rgba(255,255,255,.06);
    animation: core-float 5s ease-in-out infinite;
}
.orbit-core svg { width: 30px; height: 30px; color: #fff; }
@keyframes core-float { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-54%) scale(1.04); } }
.float-card {
    position: absolute;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 13px;
    font-size: 12.5px; font-weight: 600; color: #fff;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(0,0,0,.28);
    white-space: nowrap;
}
.float-card svg { width: 13px; height: 13px; }
.fc-1 { top: 22px; right: -8px; animation: drift 6s ease-in-out infinite; }
.fc-2 { bottom: 30px; left: -14px; animation: drift 7s ease-in-out infinite reverse; }
@keyframes drift { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    display: grid;
    place-items: center;
}
.brand-mark svg { width: 17px; height: 17px; color: #fff; }

.aside-body { margin-top: 56px; flex: 1; position: relative; z-index: 1; }
.aside-body h2 {
    margin: 0 0 10px;
    font-family: var(--serif);
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
    animation: fade-up .7s cubic-bezier(.22,.8,.32,1) .08s both;
}
.aside-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,.82);
    max-width: 320px;
    animation: fade-up .7s cubic-bezier(.22,.8,.32,1) .16s both;
}
.aside-body .orbit-stage { animation: fade-up .7s cubic-bezier(.22,.8,.32,1) .24s both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.aside-foot {
    margin-top: auto;
    padding-top: 40px;
    font-size: 12px;
    color: rgba(255,255,255,.55);
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ---------- Right form panel ---------- */
.auth-main {
    display: grid;
    place-items: center;
    padding: 52px 48px;
    background: #fff;
}
.auth-panel { width: 100%; max-width: 400px; }
.mobile-brand { display: none; }

.auth-panel h1 {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-size: 32px;
    line-height: 1.15;
    color: var(--ink);
}
.auth-panel .lead {
    margin: 0 0 24px;
    font-size: 15px;
    color: var(--muted);
    line-height: 1.5;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
}
.alert strong { color: var(--ink); font-weight: 600; }
.alert svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: #ef4444; }

.field { margin-bottom: 20px; }
.turnstile-field { margin-bottom: 16px; min-height: 65px; }
.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.label-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.005em;
    text-transform: none;
    margin-bottom: 0;
}
.label-row .opt {
    font-weight: 400;
    font-size: 12px;
    color: var(--faint);
    text-transform: none;
}
.label-row .aside-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
}
.control { position: relative; }
.control > .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--faint);
    pointer-events: none;
}
/* Scoped to .control so brand.css's `input[type=text]` rules (0,1,1)
   cannot override the icon padding and radius. */
.control .input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.control.with-toggle .input { padding-right: 44px; }
.control .input::placeholder { color: #a8b2bd; }
.control .input:hover { border-color: #d8d2c7; }
.control .input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}
.pw-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
}
.pw-toggle:hover { background: var(--wash); color: var(--ink); }
.pw-toggle svg { width: 15px; height: 15px; }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
}
.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}
.check input {
    width: 17px; height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

.btn {
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .1s, box-shadow .15s, background .15s;
}
.btn-primary {
    position: relative;
    color: #fff;
    background: linear-gradient(180deg, #5b53f2 0%, #4f46e5 100%);
    box-shadow: 0 14px 28px -12px rgba(79, 70, 229, .45);
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary.is-loading { pointer-events: none; opacity: .85; }
.btn-primary.is-loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Visible keyboard focus */
.input:focus-visible,
.btn:focus-visible,
.social:focus-visible,
.brand:focus-visible,
.page-footer a:focus-visible,
.aside-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.socials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.social {
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s;
    text-decoration: none;
}
.social:hover { background: var(--wash); border-color: #d8d2c7; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.social svg { width: 16px; height: 16px; flex-shrink: 0; }

.auth-alt {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--text);
}
.auth-alt a { font-weight: 700; color: var(--ink); }

/* ---------- Register-only helpers (pw meter, hint, terms) ---------- */
.hint { margin-top: 6px; font-size: 11.5px; color: var(--faint, #a8b2bd); line-height: 1.5; }
.hint.ok { color: #059669; }
.hint.bad { color: #dc2626; }
.pw-meter {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 8px;
}
.pw-meter span {
    height: 4px;
    border-radius: 999px;
    background: #e8edf5;
    transition: background .15s;
}
.pw-meter.lvl-1 span:nth-child(1) { background: #ef4444; }
.pw-meter.lvl-2 span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter.lvl-3 span { background: #10b981; }
.terms {
    margin: 12px 0 0;
    text-align: center;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.6;
}

.page-footer {
    margin-top: auto;
    padding: 22px 20px 26px;
    text-align: center;
    font-size: 12px;
    color: var(--faint);
}
.page-footer a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(13,13,18,.18); text-underline-offset: 3px; }
.page-footer a:hover { color: var(--ink); }

/* ---------- Mobile: compact gradient header ---------- */
@media (max-width: 900px) {
    body { background: var(--paper); }
    .auth-shell {
        grid-template-columns: 1fr;
        width: min(480px, calc(100% - 24px));
        min-height: 0;
        margin: 16px auto;
        border-radius: 20px;
        box-shadow: 0 24px 64px -32px rgba(13, 13, 18, .25);
    }
    .auth-aside {
        padding: 22px 24px;
        border-radius: 20px 20px 0 0;
    }
    .aside-body { margin-top: 14px; }
    .aside-body h2 { font-size: 24px; animation: none; }
    .aside-body p { font-size: 13px; animation: none; }
    .orbit-stage, .aside-foot { display: none; }
    .auth-main { padding: 32px 24px 34px; }
    .auth-panel { max-width: none; }
    .mobile-brand { display: none; }
    .control .input, .btn { height: 52px; font-size: 16px; }
    .auth-panel h1 { font-size: 28px; }
    .page-footer { margin-top: 0; padding-bottom: 30px; }
}
@media (max-width: 420px) {
    .auth-main { padding: 28px 16px 32px; }
    /* Icon-only row — avoids a tall 3-row stack on narrow phones */
    .socials { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .social { height: 48px; font-size: 0; gap: 0; padding: 0; }
    .social svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-shell, .aside-body h2, .aside-body p, .aside-body .orbit-stage { animation: none !important; }
    .orbit-a, .orbit-b, .orbit-a .sat, .orbit-b .sat,
    .orbit-core, .float-card, .btn-primary.is-loading::after { animation: none !important; }
    * { transition: none !important; }
}
