/* =========================
   Theme & variables
   ========================= */
:root {
    --ink: #ffffff;
    --ink-soft: rgba(255, 255, 255, .78);
    --bg: #0c0a14; /* overall page fallback */
    --panel: #1f1f1f; /* same dark gray as the input dock background */
    --border: rgba(255, 255, 255, .10);
    --field: #1c1b23; /* input background for form fields */
    --focus: #8b5cf6; /* violet-ish focus */
}

/* =========================
   Base / reset
   ========================= */
* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--panel);
    font: 16px/1.5 "Montserrat", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}


/* =========================
   Layout shell
   ========================= */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
}


@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
}


/* =========================
   Logo (fixed)
   ========================= */
.logo-link {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px
}

/* =========================
   Left panel (login) — solid dark gray (no gradient)
   ========================= */
.panel-left {
    background: var(--panel);
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    justify-content: stretch;
    justify-items: center;
    padding: 48px 28px;
    gap: 18px;
}

@media (max-width: 520px) {
    .panel-left {
        padding: 44px 16px;
    }

    .title,
    .btn,
    .or,
    .form {
        max-width: 100%;
    }
}

.panel-inner {
    display: contents;
}

.title {
    margin: 0 0 16px;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: .01em;
    width: 100%;
    max-width: 420px; /* stretch wider */
}


/* Buttons */
.btn {
    width: 100%;
    max-width: 420px; /* stretch wider */
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font: inherit; /* ensure buttons use the Montserrat font from <body> */
    font-size: 15px;
    font-weight: 650;
    transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
    margin-left: 0;
    margin-right: 0;
}


.btn:active {
    transform: translateY(1px)
}

.btn.oauth {
    background: #1f1f1f;
    color: var(--ink);
    border-color: rgba(255, 255, 255, .20);
}

.btn.oauth:hover {
    background: #242427
}

.btn.primary {
    margin-top: 6px;
    background: #ffffff;
    color: #0f0f10;
    border-color: rgba(0, 0, 0, .12);
}

.btn.primary:hover {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, .22);
}

.icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5
}

/* Divider */
.or {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 12px;
    margin: 14px 0 10px;
    width: 100%;
    max-width: 420px; /* match widest inputs/buttons */
    text-transform: uppercase; /* OR in caps */
    letter-spacing: .04em;
}


.or::before, .or::after {
    content: "";
    height: 1px;
    background: rgba(255, 255, 255, .22);
    flex: 1; /* clearer divider lines */
}

.or span {
    opacity: .9
}

/* Form */
.form {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 420px;
    margin: 0
}


.field {
    display: grid;
    gap: 6px
}

.lbl {
    font-weight: 700;
    font-size: 13px
}

.field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-aux {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.85;
}


.is-hidden {
    display: none !important;
}


input[type="email"], input[type="password"] {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    padding: 0 12px;
    color: #eaeaf0;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .16);
    outline: none;
    transition: background .15s, border-color .15s;
    font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    font-weight: 400;
}

input[type="email"][readonly],
input[type="password"][readonly] {
    background-color: var(--panel);
    border-color: rgba(255, 255, 255, .10);
}

input.is-locked {
    cursor: default;
    background-color: var(--panel);
    border-color: rgba(255, 255, 255, .10);
    color: rgba(234, 234, 240, .55);
    -webkit-text-fill-color: rgba(234, 234, 240, .55);
    box-shadow: none;
}


/* kill the light autofill background (even when locked) */
input[type="email"]:-webkit-autofill,
input[type="password"]:-webkit-autofill,
input[type="email"]:-webkit-autofill:focus,
input[type="password"]:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--panel) inset;
    box-shadow: 0 0 0 1000px var(--panel) inset;
    background-color: var(--panel) !important;
    -webkit-text-fill-color: #eaeaf0;
}

/* when locked, dim the autofilled text AND border as well */
input[type="email"].is-locked:-webkit-autofill,
input[type="password"].is-locked:-webkit-autofill,
input[type="email"].is-locked:-webkit-autofill:focus,
input[type="password"].is-locked:-webkit-autofill:focus {
    -webkit-text-fill-color: rgba(234, 234, 240, .55);
}

input::placeholder {
    color: rgba(255, 255, 255, .52)
}

input:focus {
    border-color: color-mix(in oklab, var(--focus) 65%, white 0%);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .25);
}

/* override bright focus ring when locked */
/* override bright focus ring when locked */
input.is-locked:focus {
    border-color: rgba(255, 255, 255, .10);
    box-shadow: none;
}


.small {
    color: var(--ink-soft);
    font-size: 13px;
    margin: 4px 0 0
}

.link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px
}


.err {
    margin: 10px 0 0;
    color: #ff9aa2;
    font-weight: 500;
    font-size: 0.83em;
    min-height: 0.8em;
}

/* =========================
   Right panel (hero) — same background look as Find page (no animations)
   ========================= */
.panel-right {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 32px;
    margin: 0;
    border-radius: 22px;
    border: 0;
    box-shadow: none;
    background: var(--panel);
    background-clip: padding-box;
    isolation: isolate;
}


@media (max-width: 980px) {
    .panel-right {
        display: none
    }
}

/* Background layers localized to right panel */


/* Hero content (mirrors your Find page, no bg animations) */
.hero {
    width: 100%;
    display: grid;
    place-content: center;
    gap: 18px;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 24px 0;
    min-height: 100%; /* centers vertically inside the clipped area */
}


.hero-blob {
    position: absolute;
    inset: 0;
    margin: auto;
    width: min(900px, 90vw);
    height: 360px;
    border-radius: 999px;
    filter: blur(42px);
    background: radial-gradient(60% 50% at 50% 50%, rgba(186, 148, 255, .42), transparent 65%),
    radial-gradient(40% 35% at 65% 55%, rgba(86, 210, 255, .34), transparent 70%),
    radial-gradient(50% 40% at 35% 60%, rgba(255, 168, 205, .34), transparent 72%);
    opacity: .95;
    z-index: -1;
}

.hero-title {
    margin: 0;
    font-weight: 900;
    font-size: clamp(26px, 4.2vw, 52px);
    line-height: 1.06;
    letter-spacing: .01em;
    text-shadow: 0 12px 40px rgba(154, 99, 255, .35);
}

.hero-sub {
    display: none !important; /* remove the line above the dock without layout ripple */
}

.brand-inline {
    color: #fff
}

/* =========================
   Search Dock — EXACT look/behavior from Find page
   ========================= */

/* Shared spacing so textarea and ghost align exactly */
:root {
    --dock-pad-t: 10px;
    --dock-pad-l: 20px;
    --dock-pad-b: 52px;
    --who-pad-y: 4px; /* textarea top/bottom padding (also used for ghost top) */
}

/* The dock itself */
.search-dock {
    position: relative;
    margin: 10px auto 0;
    width: 420px; /* fixed as requested */
    display: flex;
    align-items: flex-start;
    border-radius: 22px;
    background: #1f1f1f;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 18px 38px rgba(0, 0, 0, .45);
    padding: var(--dock-pad-t) var(--dock-pad-l) var(--dock-pad-b) var(--dock-pad-l);
    transition: border-radius .08s ease-out, padding-bottom .08s ease-out;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

/* Super-narrow phones: keep a tiny gutter — (right panel is hidden under 980px anyway) */
@media (max-width: 420px) {
    .search-dock {
        width: calc(100vw - 24px)
    }
}

/* Textarea */
/* Textarea */
.search-dock textarea {
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: rgba(255, 255, 255, .9);
    font: inherit;
    font-size: 17px;
    line-height: 24px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    padding-top: var(--who-pad-y);
    padding-bottom: var(--who-pad-y);
    resize: none;
    overflow-y: hidden;
    max-height: 220px;
    pointer-events: none;
    user-select: none;
    caret-color: transparent;
}


/* Ghost (animated hint) — EXACT same origin as textarea text */
.ghost {
    pointer-events: none;
    position: absolute;
    left: var(--dock-pad-l);
    top: calc(var(--dock-pad-t) + var(--who-pad-y, 4px));
    color: rgba(255, 255, 255, .72);
    font: inherit;
    font-size: 17px;
    line-height: 24px;
    letter-spacing: inherit;
    z-index: 0;
    display: flex;
    align-items: center;
}

/* Send button tight to corner */
.send-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 29px;
    height: 29px;
    border-radius: 999px;
    background: rgba(197, 199, 205, .92);
    color: #1b1b1b;
    border: 1px solid rgba(0, 0, 0, .12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}

.send-btn .icon {
    width: 14px;
    height: 14px;
    stroke-width: 3
}

.search-dock.is-growing .send-btn:hover {
    transform: scale(1.05)
}

/* Reduced motion respect (for hero bg grain only; the input typing is handled in JS) */
@media (prefers-reduced-motion: reduce) {
    .panel-right .bg-grain {
        opacity: .18
    }

    /* already static */
}

.panel-right .panel-clip {
    position: absolute;
    inset: 24px;
    border-radius: inherit;
    overflow: hidden; /* clips the blurred blob and layers */
    z-index: 0;
}

.panel-right .bg-base {
    position: absolute;
    inset: 0; /* fill the clipped area */
    border-radius: inherit;
    z-index: 0;
    background: radial-gradient(1200px 800px at 50% 38%, rgba(186, 148, 255, .35) 0%, rgba(186, 148, 255, .08) 35%, transparent 60%),
    radial-gradient(900px 700px at 70% 60%, rgba(86, 210, 255, .22) 0%, rgba(86, 210, 255, .06) 45%, transparent 70%),
    radial-gradient(1100px 700px at 30% 70%, rgba(255, 168, 205, .24) 0%, rgba(255, 168, 205, .06) 45%, transparent 72%),
    radial-gradient(1600px 1000px at 50% 120%, #1a1430 0%, #0f0b1c 50%, #0b0915 100%);
}

.panel-right .bg-grain {
    position: absolute;
    inset: 0; /* fill the clipped area */
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
    opacity: .18;
    background-image: radial-gradient(1px 1px at 25% 35%, rgba(255, 255, 255, .25) 0, rgba(255, 255, 255, 0) 1px),
    radial-gradient(1px 1px at 60% 65%, rgba(255, 255, 255, .2) 0, rgba(255, 255, 255, 0) 1px),
    radial-gradient(1px 1px at 35% 75%, rgba(255, 255, 255, .18) 0, rgba(255, 255, 255, 0) 1px),
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 3px 3px, 3px 3px, 3px 3px, 48px 48px, 48px 48px;
    background-position: 0 0, 0 0, 0 0, -1px -1px, -1px -1px;
}

/* =========================
   In-app browser gate (LOGIN)
   ========================= */
.inapp body {
    overflow: hidden;
}

.inapp .auth-shell {
    display: none;
}

.inapp-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: calc(24px + env(safe-area-inset-top)) 24px 24px 24px;
    background: rgba(12, 10, 20, 0.92);
    backdrop-filter: blur(8px);
}

.inapp #inAppGate {
    display: flex;
}

.inapp-gate-card {
    width: 100%;
    max-width: 520px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: #1f1f1f;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.inapp-gate-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
}

.inapp-gate-card p {
    margin: 0 0 12px;
    color: var(--ink-soft);
}

.inapp-gate-actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

@media (min-width: 520px) {
    .inapp-gate-actions {
        grid-template-columns: 1fr 1fr;
    }
}

.inapp-gate-note {
    margin-top: 18px;
}

/* TEMP: disable in-app browser blocking for app testing */
.inapp #inAppGate {
    display: none !important;
}

.inapp .auth-shell {
    display: grid !important;
    pointer-events: auto !important;
    user-select: auto !important;
    filter: none !important;
}

.inapp body {
    overflow: auto !important;
}