/* ==========================================================================
   Sign-in pages (layouts/guest) — matches the oktopusengine.com redesign:
   a deep-navy panel with a half-visible dithered planet (public/js/auth-planet.js)
   and the form filling the light side. Figtree type, brand blue. Scoped to body.auth-v2.
   ========================================================================== */
body.auth-v2 {
    --brand: #0004f6;
    --brand-hover: #0003c9;
    --brand-soft: #eff0ff;
    --navy: #01001f;
    --navy-2: #020142;
    --primary: var(--brand);
    --primary-hover: var(--brand-hover);
    --ring: 0 0 0 3px rgba(0, 4, 246, .18);
    --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    letter-spacing: -.011em;
    background: #fff;
}

/* ---------- Layout ---------- */
.auth-v2 .auth-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ---------- Planet panel ---------- */
.auth-v2 .auth-aside {
    isolation: isolate;
    padding: clamp(28px, 4vw, 56px);
    background:
        radial-gradient(ellipse 60% 55% at 0% 56%, rgba(11, 16, 168, .55) 0%, transparent 70%),
        linear-gradient(to bottom, var(--navy), var(--navy-2));
    color: #fff;
    cursor: grab;
    touch-action: pan-y; /* horizontal drags spin the planet, vertical ones still scroll on phones */
    user-select: none;
}
.auth-v2 .auth-aside.is-dragging { cursor: grabbing; }
.auth-v2 .auth-aside::after { display: none; }
.auth-v2 .auth-aside .brand { font-size: 18px; font-weight: 600; letter-spacing: -.03em; cursor: pointer; }
.auth-v2 .auth-aside .logo { background: var(--brand); color: #fff; }
.auth-planet { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }

/* Ring counter, bottom right of the panel */
.auth-orbit { align-self: flex-end; text-align: right; pointer-events: none; }
.auth-orbit-count {
    font-family: "Silkscreen", monospace; font-weight: 700;
    font-size: clamp(40px, 4.4vw, 68px); line-height: .9; letter-spacing: -.02em; color: #e4e4ff;
}
.auth-orbit-total { color: rgba(228, 228, 255, .35); }
.auth-orbit-label { margin-top: 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.auth-orbit-hint { margin-top: 4px; font-size: 12.5px; color: rgba(255, 255, 255, .4); }
@media (hover: none) { .auth-orbit-hint { display: none; } }

/* Desktop: the panel stays one screen tall and pinned while a long form (register) scrolls beside it */
@media (min-width: 901px) {
    .auth-v2 .auth-aside { position: sticky; top: 0; height: 100vh; height: 100svh; align-self: start; }
}

/* ---------- Form side: fills the whole half ---------- */
.auth-v2 .auth-main { background: #fff; padding: clamp(40px, 6vh, 72px) clamp(28px, 6vw, 96px); }
.auth-v2 .auth-card {
    width: 100%; max-width: 640px; padding: 0;
    background: none; box-shadow: none; border-radius: 0;
    animation: auth-card-in .7s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes auth-card-in { from { opacity: 0; transform: translateY(18px); } }
.auth-v2 .auth-card h1 { font-size: clamp(32px, 3vw, 44px); font-weight: 600; letter-spacing: -.05em; line-height: 1.05; }
.auth-v2 .auth-card .subtitle { margin: 10px 0 30px; font-size: 16px; line-height: 1.5; max-width: 52ch; }

/* Two fields side by side where it reads naturally (name + company, password + confirm) */
.auth-v2 .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.auth-v2 .field-row .field { margin-bottom: 18px; }
@media (max-width: 1180px) { .auth-v2 .field-row { grid-template-columns: 1fr; } }

.auth-v2 label, .auth-v2 .label { font-size: 13.5px; font-weight: 600; }
.auth-v2 input:not([type=checkbox]):not([type=radio]):not([type=file]),
.auth-v2 select {
    height: 50px; padding: 0 16px; font-size: 15px;
    border-radius: 10px; border-color: #dcdce3; background: #f7f7fa; box-shadow: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-v2 input:hover:not(:focus) { border-color: #c4c4cf; }
.auth-v2 input:focus, .auth-v2 select:focus { border-color: var(--brand); background: #fff; box-shadow: var(--ring); }
.auth-v2 input.is-invalid { border-color: var(--danger); }
.auth-v2 input[type=checkbox] { accent-color: var(--brand); }

.auth-v2 .btn { height: 50px; border-radius: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.auth-v2 .btn:focus-visible { box-shadow: var(--ring); }
.auth-v2 .auth-card .btn-primary {
    height: 54px; margin-top: 6px; background: var(--brand);
    transition: background .2s;
}
.auth-v2 .auth-card .btn-primary:hover { background: var(--brand-hover); }
/* After submit the pressed button breaks into pixels (drawn by auth-planet.js) */
.auth-v2 .btn { position: relative; overflow: hidden; }
.auth-v2 .btn.is-sending { pointer-events: none; }
.btn-pixels { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-v2 .btn-google { border-color: #dcdce3; background: #fff; box-shadow: none; }
.auth-v2 .btn-google:hover { background: var(--brand-soft); border-color: #c9cbff; }

.auth-v2 .divider { color: #9a9aa6; }
.auth-v2 .small-link, .auth-v2 .auth-footer a { color: var(--brand); font-weight: 600; }
.auth-v2 .small-link:hover, .auth-v2 .auth-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-v2 a.link { text-decoration-color: rgba(0, 4, 246, .35); }
.auth-v2 .auth-footer { font-size: 14px; text-align: left; }
.auth-v2 .back-link { margin-top: 22px; font-size: 14px; transition: color .15s; }
.auth-v2 .back-link:hover { color: var(--brand); }
.auth-v2 a:focus-visible, .auth-v2 .checkbox:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ---------- Tablet and phone: the panel becomes a header with the planet rising from its bottom ---------- */
@media (max-width: 900px) {
    .auth-v2 .auth-wrap { grid-template-columns: 1fr; min-height: 100svh; }
    .auth-v2 .auth-aside {
        display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start;
        height: clamp(220px, 34svh, 300px); padding: 18px 20px;
        background: linear-gradient(to bottom, var(--navy), var(--navy-2));
    }
    .auth-orbit { align-self: flex-start; }
    .auth-orbit-count { font-size: 30px; }
    .auth-orbit-label { margin-top: 4px; font-size: 11px; }
    .auth-v2 .auth-main { padding: 28px 20px calc(32px + env(safe-area-inset-bottom)); place-items: start center; }
    .auth-v2 .auth-card h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-v2 .auth-card { animation: none; }
}
