/* ==========================================================================
   BuildOne - Auth screens (Login, status/error pages)
   Self-contained: does NOT load the Gull/Bootstrap theme, so the login
   page is light (~15 KB CSS) and paints instantly on mobile data.
   ========================================================================== */

:root {
    --a-bg-1: #070B16;
    --a-bg-2: #0F1A2E;
    --a-bg-3: #1B2740;
    --a-accent: #FF6600;
    --a-accent-2: #FF8A3D;
    --a-accent-rgb: 255, 102, 0;
    --a-text: #F8FAFC;
    --a-muted: #94A3B8;
    --a-card: rgba(15, 23, 42, .62);
    --a-card-border: rgba(255, 255, 255, .10);
    --a-input: rgba(255, 255, 255, .06);
    --a-input-border: rgba(255, 255, 255, .14);
    --a-danger: #F87171;
    --a-success: #4ADE80;
    --a-font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body.bo-auth {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--a-font);
    color: var(--a-text);
    background: radial-gradient(120% 90% at 50% 110%, #2A1A12 0%, var(--a-bg-2) 42%, var(--a-bg-1) 100%);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ---------------- Animated background ---------------- */
.bo-auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.bo-auth-grid {
    position: absolute;
    inset: -2px;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 35%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 20%, transparent 75%);
    animation: bo-grid-pan 40s linear infinite;
}
@keyframes bo-grid-pan { to { background-position: 44px 44px, 44px 44px; } }

.bo-auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    will-change: transform;
}
.bo-auth-glow-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(var(--a-accent-rgb), .55), transparent 65%);
    bottom: -220px; left: 50%;
    transform: translateX(-50%);
    animation: bo-glow-pulse 9s ease-in-out infinite;
}
.bo-auth-glow-2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(56, 189, 248, .28), transparent 65%);
    top: -160px; right: -120px;
    animation: bo-glow-drift 16s ease-in-out infinite alternate;
}
@keyframes bo-glow-pulse { 50% { opacity: .8; transform: translateX(-50%) scale(1.12); } }
@keyframes bo-glow-drift { to { transform: translate(-80px, 60px); } }

.bo-auth-stars {
    position: absolute;
    inset: 0 0 45% 0;
    background-image:
        radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent),
        radial-gradient(1px 1px at 28% 42%, #fff, transparent),
        radial-gradient(1.2px 1.2px at 46% 12%, #fff, transparent),
        radial-gradient(1px 1px at 63% 30%, #fff, transparent),
        radial-gradient(1.4px 1.4px at 78% 8%, #fff, transparent),
        radial-gradient(1px 1px at 88% 36%, #fff, transparent),
        radial-gradient(1px 1px at 6% 52%, #fff, transparent),
        radial-gradient(1.2px 1.2px at 36% 26%, #fff, transparent),
        radial-gradient(1px 1px at 55% 48%, #fff, transparent),
        radial-gradient(1.3px 1.3px at 93% 20%, #fff, transparent);
    opacity: .5;
    animation: bo-twinkle 6s ease-in-out infinite alternate;
}
@keyframes bo-twinkle { to { opacity: .2; } }

/* Floating real-estate icons */
.bo-auth-floaters i {
    position: absolute;
    bottom: -60px;
    color: rgba(255, 255, 255, .09);
    animation-name: bo-float-up;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}
.bo-auth-floaters i:nth-child(3n) { color: rgba(var(--a-accent-rgb), .16); }
@keyframes bo-float-up {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { transform: translate3d(30px, -110vh, 0) rotate(25deg); opacity: 0; }
}

/* Skyline parallax layers: two copies side by side, panned -50% */
.bo-sky-layer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 200%;
    display: flex;
    will-change: transform;
}
.bo-sky-layer svg { width: 50%; display: block; }
.bo-sky-layer-far  { height: 62vh; animation: bo-pan 160s linear infinite; opacity: .55; }
.bo-sky-layer-mid  { height: 48vh; animation: bo-pan 110s linear infinite; }
.bo-sky-layer-near { height: 30vh; animation: bo-pan 70s linear infinite; }
@keyframes bo-pan { to { transform: translate3d(-50%, 0, 0); } }

.bo-sky-far  { fill: #16233B; }
.bo-sky-mid  { fill: #101B2E; }
.bo-sky-near { fill: #0A1220; }
.bo-sky-win {
    fill: #FFC37A;
    opacity: 0;
    animation-name: bo-window;
    animation-iteration-count: infinite;
    animation-timing-function: steps(1, end);
}
.bo-sky-win-on { opacity: .75; animation: none; }
@keyframes bo-window {
    0%   { opacity: 0; }
    30%  { opacity: .85; }
    75%  { opacity: .85; }
    100% { opacity: 0; }
}
.bo-sky-beacon {
    fill: #FF3B30;
    animation: bo-beacon 1.6s ease-in-out infinite;
}
@keyframes bo-beacon { 50% { opacity: .15; } }

/* Tower crane */
.bo-crane {
    position: absolute;
    left: 46%;
    bottom: 18vh;
    height: 52vh;
    max-height: 520px;
    opacity: .9;
}
.bo-crane-mast rect, .bo-crane-top rect { fill: #1E2B45; }
.bo-crane-mast path { stroke: #1E2B45; stroke-width: 2; fill: none; }
.bo-crane-cable { stroke: #2C3B5C; stroke-width: 2; fill: none; }
.bo-crane-top .bo-crane-weight { fill: #24324F; }
.bo-crane-top .bo-crane-cab { fill: var(--a-accent); opacity: .85; }
.bo-crane-top .bo-crane-load { fill: var(--a-accent); }
.bo-crane-top {
    transform-box: view-box;
    transform-origin: 155px 63px;
    animation: bo-crane-slew 18s ease-in-out infinite alternate;
}
@keyframes bo-crane-slew {
    0%   { transform: scaleX(1); }
    45%  { transform: scaleX(.55); }
    100% { transform: scaleX(-.85); }
}
.bo-crane-hook-cable {
    transform-box: view-box;
    transform-origin: 60px 68px;
    animation: bo-crane-cable 7s ease-in-out infinite alternate;
}
.bo-crane-load {
    animation: bo-crane-load 7s ease-in-out infinite alternate;
}
@keyframes bo-crane-cable { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
@keyframes bo-crane-load { from { transform: translateY(-67px); } to { transform: translateY(0); } }

.bo-auth-ground {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 10vh;
    background: linear-gradient(to top, #05080F, rgba(5, 8, 15, 0));
}

@media (prefers-reduced-motion: reduce) {
    .bo-auth-bg *, .bo-auth-bg *::before, .bo-auth-bg *::after { animation: none !important; }
}

/* ---------------- Layout ---------------- */
.bo-auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    max-width: 1180px;
    margin: 0 auto;
    padding: max(32px, env(safe-area-inset-top)) 32px max(32px, env(safe-area-inset-bottom));
}

.bo-auth-hero { padding-right: 8px; }
.bo-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--a-text);
}
.bo-auth-brand img { height: 44px; width: auto; }
.bo-auth-brand span { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.bo-auth-brand span b { color: var(--a-accent); font-weight: 800; }

.bo-auth-hero h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -.03em;
    margin: 36px 0 16px;
    font-weight: 800;
}
.bo-auth-hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--a-accent), #FFB067);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.bo-auth-hero p { color: var(--a-muted); font-size: 16px; line-height: 1.65; max-width: 470px; margin: 0; }

.bo-auth-points {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: grid;
    gap: 12px;
}
.bo-auth-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    color: #CBD5E1;
    opacity: 0;
    transform: translateY(10px);
    animation: bo-rise .6s ease forwards;
}
.bo-auth-points li:nth-child(1) { animation-delay: .25s; }
.bo-auth-points li:nth-child(2) { animation-delay: .4s; }
.bo-auth-points li:nth-child(3) { animation-delay: .55s; }
.bo-auth-points li:nth-child(4) { animation-delay: .7s; }
.bo-auth-points li i {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--a-accent-rgb), .14);
    color: var(--a-accent-2);
    font-size: 14px;
    flex-shrink: 0;
}
@keyframes bo-rise { to { opacity: 1; transform: none; } }

/* ---------------- Card ---------------- */
.bo-auth-card {
    width: 100%;
    max-width: 440px;
    justify-self: end;
    background: var(--a-card);
    border: 1px solid var(--a-card-border);
    border-radius: 24px;
    padding: 38px 34px 30px;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .06);
    animation: bo-card-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes bo-card-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }

.bo-auth-card-logo {
    width: 64px; height: 64px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .12);
    margin-bottom: 22px;
}
.bo-auth-card-logo img { height: 38px; width: auto; }
.bo-auth-card h2 { font-size: 26px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.02em; }
.bo-auth-card .bo-auth-sub { color: var(--a-muted); margin: 0 0 26px; font-size: 14.5px; }

.bo-auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
    background: rgba(248, 113, 113, .12);
    border: 1px solid rgba(248, 113, 113, .35);
    color: #FECACA;
}
.bo-auth-alert.bo-auth-alert-info { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .35); color: #BAE6FD; }
.bo-auth-alert.bo-auth-alert-warn { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .35); color: #FDE68A; }
.bo-auth-alert ul { margin: 0; padding-left: 0; list-style: none; }

.bo-field { margin-bottom: 18px; }
.bo-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #CBD5E1;
    margin-bottom: 8px;
}
.bo-input-wrap { position: relative; }
.bo-input-wrap > i {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--a-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color .2s;
}
.bo-input {
    width: 100%;
    height: 54px;
    border-radius: 14px;
    border: 1px solid var(--a-input-border);
    background: var(--a-input);
    color: var(--a-text);
    font-family: inherit;
    /* 16px+ is required: iOS Safari zooms the whole page into any
       input with a smaller font, which is what made the old login
       feel tiny-then-jumpy on phones. */
    font-size: 16px;
    padding: 0 48px 0 46px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}
.bo-input::placeholder { color: #64748B; }
.bo-input:focus {
    border-color: rgba(var(--a-accent-rgb), .8);
    background: rgba(255, 255, 255, .09);
    box-shadow: 0 0 0 4px rgba(var(--a-accent-rgb), .18);
}
.bo-input-wrap:focus-within > i { color: var(--a-accent-2); }
.bo-input:-webkit-autofill,
.bo-input:-webkit-autofill:hover,
.bo-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--a-text);
    -webkit-box-shadow: 0 0 0 1000px #1A2438 inset;
    caret-color: var(--a-text);
    transition: background-color 9999s ease-out 0s;
}
.bo-eye {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 42px; height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--a-muted);
    cursor: pointer;
    font-size: 16px;
}
.bo-eye:hover, .bo-eye:focus-visible { color: var(--a-text); background: rgba(255, 255, 255, .06); outline: none; }

.bo-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 22px;
    font-size: 14px;
    color: #CBD5E1;
}
.bo-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.bo-check input {
    width: 20px; height: 20px;
    accent-color: var(--a-accent);
    cursor: pointer;
}
.bo-caps { color: #FDE68A; font-size: 12.5px; display: none; margin-top: 8px; }
.bo-caps.show { display: block; }

.bo-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--a-accent) 0%, #FF8A3D 100%);
    box-shadow: 0 14px 30px -12px rgba(var(--a-accent-rgb), .75);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .2s ease, filter .2s;
}
.bo-auth-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -60%;
    width: 50%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: bo-shine 3.8s ease-in-out infinite;
}
@keyframes bo-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.bo-auth-btn:hover { filter: brightness(1.06); box-shadow: 0 18px 36px -12px rgba(var(--a-accent-rgb), .85); }
.bo-auth-btn:active { transform: scale(.985); }
.bo-auth-btn:disabled { opacity: .75; cursor: progress; }
.bo-auth-btn .bo-spin { display: none; }
.bo-auth-btn.is-loading .bo-spin { display: inline-block; }
.bo-auth-btn.is-loading .bo-btn-icon { display: none; }
.bo-auth-btn-ghost {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: none;
}
.bo-auth-btn-ghost::after { display: none; }

.bo-auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--a-muted);
}
.bo-auth-foot a { color: #E2E8F0; text-decoration: none; font-weight: 600; }
.bo-auth-foot a:hover { color: var(--a-accent-2); }
.bo-auth-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.bo-auth-links a { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- Mobile / installed app ---------------- */
@media (max-width: 900px) {
    .bo-auth-shell {
        grid-template-columns: 1fr;
        gap: 22px;
        align-content: center;
        padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    }
    .bo-auth-hero { text-align: center; padding: 0; }
    .bo-auth-hero h1, .bo-auth-hero p, .bo-auth-points { display: none; }
    .bo-auth-brand img { height: 46px; }
    .bo-auth-brand span { font-size: 28px; }
    .bo-auth-card {
        justify-self: center;
        max-width: 480px;
        padding: 30px 22px 24px;
        border-radius: 26px;
    }
    .bo-auth-card-logo { display: none; }
    .bo-auth-card h2 { font-size: 27px; text-align: center; }
    .bo-auth-card .bo-auth-sub { text-align: center; font-size: 15px; }
    .bo-field label { font-size: 14.5px; }
    .bo-input, .bo-auth-btn { height: 58px; font-size: 17px; border-radius: 16px; }
    .bo-input { padding-left: 48px; }
    .bo-auth-row { font-size: 15px; }
    .bo-crane { left: auto; right: -40px; height: 42vh; bottom: 14vh; opacity: .6; }
    .bo-sky-layer-far { height: 48vh; }
    .bo-sky-layer-mid { height: 36vh; }
    .bo-sky-layer-near { height: 22vh; }
}
@media (max-height: 640px) and (max-width: 900px) {
    .bo-auth-shell { align-content: start; }
}

/* ---------------- Status / error page ---------------- */
.bo-status-page { display: flex; align-items: center; justify-content: center; padding: 20px; }
.bo-status-card {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 460px;
    width: 100%;
    background: var(--a-card);
    border: 1px solid var(--a-card-border);
    border-radius: 24px;
    padding: 40px 28px 30px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65);
    animation: bo-card-in .6s ease both;
}
.bo-status-code {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    background: linear-gradient(90deg, var(--a-accent), #FFB067);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.bo-status-icon { font-size: 26px; color: var(--a-muted); margin: 12px 0 6px; }
.bo-status-card h1 { font-size: 24px; margin: 6px 0 8px; font-family: var(--a-font); }
.bo-status-card p { color: var(--a-muted); margin: 0 0 24px; line-height: 1.6; font-family: var(--a-font); }
.bo-status-actions { display: grid; gap: 12px; }
.bo-status-page .bo-auth-btn { font-family: var(--a-font); }
