/* ==========================================================================
   OrbitChat sign-in screens: login, register, password reset, codes, 2FA.
   Builds on the tokens in orbit.css. The form side follows the visitor's
   theme; the product side (.oc-auth__aside) is always dark.
   ========================================================================== */

body.oc-auth {
    --bg-main: var(--oc-bg);
    --text-primary: var(--oc-text);
    --color-primary: var(--oc-brand-text);
    margin: 0;
    min-height: 100vh;
    background: var(--oc-bg);
    color: var(--oc-text);
    font-family: var(--oc-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
}
body.oc-auth.rtl {
    --oc-font-display: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
    --oc-font-body: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
    --oc-font-serif: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
}
.oc-auth ::selection { background: var(--oc-brand); color: var(--oc-brand-ink); }
.oc-auth :focus-visible { outline: 2px solid var(--oc-brand-text); outline-offset: 3px; border-radius: 6px; }
.oc-auth h1, .oc-auth h2 { font-family: var(--oc-font-display); color: var(--oc-text); }

/* ---------- frame ---------- */
.oc-auth__shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 992px) {
    .oc-auth__shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
}

.oc-auth__main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px clamp(20px, 4.5vw, 56px) 24px;
    isolation: isolate;
}
/* a faint brand glow behind the form; on small screens it is the only colour on the page */
.oc-auth__main::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -10% -20% auto auto;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--oc-brand-soft), transparent);
    filter: blur(20px);
    pointer-events: none;
}
@media (min-width: 992px) { .oc-auth__main::before { opacity: .55; } }

.oc-auth__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.oc-auth__top .navbar-brand { display: inline-flex; padding: 0; margin: 0; }
.oc-auth__top .navbar-brand img { height: 34px; width: auto; }
.oc-auth__top-actions { display: flex; align-items: center; gap: 4px; }
.oc-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--oc-text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s, color .2s;
}
.oc-auth__back:hover { background: var(--oc-surface-2); color: var(--oc-text); }
[dir="rtl"] .oc-auth__back .bi { transform: scaleX(-1); }
@media (max-width: 420px) { .oc-auth__back span { display: none; } }

.oc-auth__body { flex: 1; display: grid; place-items: center; padding-block: clamp(40px, 7vh, 72px); }
.oc-auth__form { width: 100%; max-width: 420px; }

.oc-auth__foot { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--oc-muted); font-size: 13px; }
.oc-auth__foot a { color: var(--oc-muted); text-decoration: none; }
.oc-auth__foot a:hover { color: var(--oc-text); }

/* ---------- form heading ---------- */
.oc-auth__head { margin-bottom: 32px; }
.oc-auth__badge {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 22px;
    border-radius: 16px;
    background: var(--oc-brand-soft);
    border: 1px solid var(--oc-brand-line);
    color: var(--oc-brand-text);
    font-size: 22px;
}
.oc-auth__title {
    margin: 0 0 10px;
    font-size: clamp(1.85rem, 1.5rem + 1vw, 2.35rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.045em;
    text-wrap: balance;
}
.oc-auth__sub { margin: 0; color: var(--oc-text-2); font-size: 15.5px; line-height: 1.6; text-wrap: pretty; }
.oc-auth__sub strong { color: var(--oc-text); font-weight: 600; word-break: break-all; }

/* ---------- fields ---------- */
.oc-auth__fields { display: flex; flex-direction: column; gap: 18px; }
.oc-auth__fields > .row { --bs-gutter-y: 18px; }
.oc-field { display: flex; flex-direction: column; gap: 8px; }
.oc-field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.oc-field__label { margin: 0; color: var(--oc-text); font-size: 14px; font-weight: 500; letter-spacing: -0.005em; }
.oc-field__hint { margin: 0; color: var(--oc-muted); font-size: 13px; line-height: 1.5; }

.oc-input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--oc-border-strong);
    background: var(--oc-surface);
    color: var(--oc-text);
    font: inherit;
    font-size: 15px;
    box-shadow: var(--oc-shadow-sm);
    transition: border-color .2s var(--oc-ease), box-shadow .2s var(--oc-ease), background-color .2s;
}
.oc-input::placeholder { color: var(--oc-muted); opacity: .8; }
.oc-input:hover { border-color: color-mix(in srgb, var(--oc-text) 22%, transparent); }
.oc-input:focus {
    outline: none;
    border-color: var(--oc-brand-line);
    box-shadow: 0 0 0 4px var(--oc-brand-soft);
}
.oc-input.is-invalid { border-color: rgba(239, 68, 68, .6); }
.oc-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, .14); }
/* browsers paint autofilled fields yellow or blue; keep them on the surface colour */
.oc-input:-webkit-autofill {
    -webkit-text-fill-color: var(--oc-text);
    -webkit-box-shadow: 0 0 0 1000px var(--oc-surface) inset;
    caret-color: var(--oc-text);
}

.oc-input-wrap { position: relative; }
.oc-input-wrap .oc-input { padding-inline-end: 52px; }
.oc-input-wrap .password-toggle {
    position: absolute;
    inset-inline-end: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--oc-muted);
    font-size: 17px;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.oc-input-wrap .password-toggle:hover { background: var(--oc-surface-2); color: var(--oc-text); }

.oc-auth__error { margin: 0; color: #F87171; font-size: 13px; line-height: 1.45; }
[data-theme="light"] .oc-auth__error { color: #DC2626; }

.oc-auth__link { color: var(--oc-brand-text); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.oc-auth__link:hover { text-decoration: underline; text-underline-offset: 3px; }

.oc-check { display: flex; align-items: flex-start; gap: 11px; margin: 0; color: var(--oc-text-2); font-size: 14px; line-height: 1.5; cursor: pointer; }
.oc-check input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--oc-brand);
    cursor: pointer;
}
[data-theme="light"] .oc-check input { accent-color: #0B0C0A; }
.oc-check a { color: var(--oc-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--oc-border-strong); }
.oc-check a:hover { text-decoration-color: currentColor; }

.oc-auth__fields .oc-btn { margin-top: 6px; }
.oc-auth__fields .oc-btn .bi { transition: transform .2s var(--oc-ease); }
.oc-auth__fields .oc-btn:hover .bi { transform: translateX(3px); }
[dir="rtl"] .oc-auth__fields .oc-btn .bi { transform: scaleX(-1); }
[dir="rtl"] .oc-auth__fields .oc-btn:hover .bi { transform: scaleX(-1) translateX(3px); }

.oc-auth__switch { margin: 28px 0 0; text-align: center; color: var(--oc-muted); font-size: 14.5px; }
.oc-auth__switch a { color: var(--oc-text); font-weight: 500; text-decoration: none; }
.oc-auth__switch a:hover { color: var(--oc-brand-text); }
[dir="rtl"] .oc-auth__switch .bi-arrow-left { transform: scaleX(-1); display: inline-block; }

.oc-auth__hint {
    display: flex;
    gap: 10px;
    margin: 24px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--oc-surface-2);
    border: 1px solid var(--oc-border);
    color: var(--oc-text-2);
    font-size: 13.5px;
    line-height: 1.5;
}
.oc-auth__hint .bi { color: var(--oc-accent-text); }

/* ---------- 6-digit code ---------- */
.oc-otp { display: flex; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.oc-otp__box {
    flex: 1 1 0;
    min-width: 0;
    height: 62px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--oc-border-strong);
    background: var(--oc-surface);
    color: var(--oc-text);
    font-family: var(--oc-font-mono);
    font-size: 24px;
    font-weight: 500;
    text-align: center;
    caret-color: var(--oc-brand-text);
    box-shadow: var(--oc-shadow-sm);
    transition: border-color .2s var(--oc-ease), box-shadow .2s var(--oc-ease), transform .2s var(--oc-ease);
}
/* a little gap splits the code into two groups of three, the way people read it */
.oc-otp__box:nth-of-type(4) { margin-inline-start: 8px; }
.oc-otp__box:focus { outline: none; border-color: var(--oc-brand-line); box-shadow: 0 0 0 4px var(--oc-brand-soft); transform: translateY(-1px); }
.oc-otp__box.is-invalid { border-color: rgba(239, 68, 68, .6); }
@media (max-width: 380px) { .oc-otp { gap: 6px; } .oc-otp__box { height: 54px; font-size: 20px; } .oc-otp__box:nth-of-type(4) { margin-inline-start: 4px; } }

.oc-auth__resend { margin: 4px 0 0; text-align: center; color: var(--oc-muted); font-size: 14px; }
.oc-auth__resend b { color: var(--oc-text); font-family: var(--oc-font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.oc-auth__resend a { color: var(--oc-brand-text); font-weight: 500; text-decoration: none; }
.oc-auth__resend a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- product side ---------- */
.oc-auth__aside { display: none; }
@media (min-width: 992px) {
    .oc-auth__aside {
        position: sticky;
        top: 12px;
        display: flex;
        align-items: center;
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
        min-height: 640px;
        margin: 12px;
        margin-inline-start: 0;
        border-radius: 28px;
        overflow: hidden;
        background:
            radial-gradient(120% 80% at 100% 0%, rgba(200, 244, 60, .14), transparent 55%),
            radial-gradient(90% 70% at 0% 100%, rgba(92, 200, 245, .12), transparent 60%),
            #0A0B0C;
        color: var(--oc-text);
        isolation: isolate;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    }
    /* fine grid, faded towards the edges */
    .oc-auth__aside::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-image:
            linear-gradient(var(--oc-grid-line) 1px, transparent 1px),
            linear-gradient(90deg, var(--oc-grid-line) 1px, transparent 1px);
        background-size: 44px 44px;
        -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 100%);
        mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 100%);
    }
}

.oc-auth__aside-inner { position: relative; width: 100%; max-width: 520px; margin-inline: auto; padding: clamp(40px, 5vw, 64px); }
.oc-auth__glow {
    position: absolute;
    z-index: -1;
    top: 38%;
    inset-inline-end: 0;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(200, 244, 60, .18), transparent);
    filter: blur(30px);
    pointer-events: none;
}

.oc-auth__headline {
    margin: 0 0 36px;
    font-size: clamp(2rem, 1.1rem + 1.7vw, 2.9rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.045em;
    text-wrap: balance;
}
.oc-auth__headline em {
    display: block;
    font-family: var(--oc-font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.1em;
    letter-spacing: -0.02em;
    background: var(--oc-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-inline-end: .06em;
}

/* sign in: a live conversation */
.oc-auth__chat {
    border-radius: 20px;
    background: var(--oc-surface);
    border: 1px solid var(--oc-border-strong);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .02), var(--oc-shadow-glow);
    overflow: hidden;
    font-size: 13.5px;
}
.oc-auth__chat .oc-app__chat-head strong { font-size: 14px; }
.oc-auth__chat .oc-app__messages { gap: 10px; padding: 18px; }
.oc-auth__chat .oc-system { display: inline-flex; align-items: center; gap: 6px; }

.oc-auth__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.oc-auth__chips li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--oc-border-strong);
    background: rgba(255, 255, 255, .03);
    color: var(--oc-text-2);
    font-size: 13px;
}
.oc-auth__chips .bi { color: var(--oc-brand-text); }

/* create account: three steps */
.oc-auth__steps { position: relative; margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.oc-auth__steps li {
    position: relative;
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
    border: 1px solid var(--oc-border);
}
.oc-auth__steps li:first-child { border-color: var(--oc-brand-line); background: linear-gradient(180deg, rgba(200, 244, 60, .09), rgba(200, 244, 60, .02)); }
.oc-auth__step-num {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--oc-border-strong);
    color: var(--oc-text-2);
    font-family: var(--oc-font-mono);
    font-size: 12.5px;
}
.oc-auth__steps li:first-child .oc-auth__step-num { background: var(--oc-brand); border-color: transparent; color: var(--oc-brand-ink); }
.oc-auth__steps strong { display: block; margin-bottom: 3px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.oc-auth__steps p { margin: 0; color: var(--oc-muted); font-size: 14px; line-height: 1.5; }

.oc-auth__note { display: flex; align-items: center; gap: 10px; margin: 24px 0 0; color: var(--oc-text-2); font-size: 14px; }
.oc-auth__note .bi { color: var(--oc-brand-text); font-size: 17px; }

/* codes and passwords: a shield inside orbiting rings */
.oc-auth__shield { position: relative; width: 260px; height: 260px; margin: 0 0 36px; }
.oc-auth__ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1px solid var(--oc-border-strong); }
.oc-auth__ring--1 { width: 100%; height: 100%; border-style: dashed; border-color: rgba(255, 255, 255, .1); }
.oc-auth__ring--2 { width: 72%; height: 72%; }
.oc-auth__ring--3 { width: 46%; height: 46%; border-color: var(--oc-brand-line); background: radial-gradient(closest-side, rgba(200, 244, 60, .12), transparent); }
.oc-auth__shield-core {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: linear-gradient(140deg, #E2FF8A, #C8F43C 50%, #93CC17);
    color: var(--oc-brand-ink);
    font-size: 32px;
    box-shadow: 0 20px 50px -12px rgba(200, 244, 60, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.oc-auth__dot { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.oc-auth__dot::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; top: -5px; left: calc(50% - 5px); }
.oc-auth__dot--1 { width: 100%; height: 100%; }
.oc-auth__dot--1::after { background: var(--oc-brand); box-shadow: 0 0 14px var(--oc-brand); }
.oc-auth__dot--2 { width: 72%; height: 72%; transform: rotate(140deg); }
.oc-auth__dot--2::after { background: var(--oc-accent); box-shadow: 0 0 14px var(--oc-accent); }
@media (prefers-reduced-motion: no-preference) {
    .oc-auth__dot--1 { animation: oc-auth-orbit 14s linear infinite; }
    .oc-auth__dot--2 { animation: oc-auth-orbit-2 10s linear infinite reverse; }
}
@keyframes oc-auth-orbit { to { transform: rotate(360deg); } }
@keyframes oc-auth-orbit-2 { from { transform: rotate(140deg); } to { transform: rotate(500deg); } }

.oc-auth__checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.oc-auth__checks li { display: flex; align-items: center; gap: 12px; color: var(--oc-text-2); font-size: 15px; }
.oc-auth__checks .bi {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--oc-brand-soft);
    color: var(--oc-brand-text);
    font-size: 15px;
}

/* the aside eyebrow sits on a dark panel in both themes */
.oc-auth__aside .oc-eyebrow { background: rgba(255, 255, 255, .04); }

/* entrance: the form and the product side ease in once */
@media (prefers-reduced-motion: no-preference) {
    .oc-auth__form { animation: oc-auth-in .6s var(--oc-ease) both; }
    .oc-auth__aside-inner { animation: oc-auth-in .8s .08s var(--oc-ease) both; }
}
@keyframes oc-auth-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* on the light background the blurred glow bands into rings; the dark panel carries the colour instead */
@media (min-width: 992px) { [data-theme="light"] .oc-auth__main::before { display: none; } }
