/*
 * Auth atmosphere — ecommerce fulfillment vibe for login + signup only.
 *
 * Brand from Mac app icon: navy #182038 + neon gold #F4B804.
 * Feel: packing bay at rest with taped parcels on outbound routes.
 * Scoped under `.auth-atmosphere-page` so light-theme auth.css stays untouched.
 */

.auth-atmosphere-page {
    --auth-ink: #eef2fb;
    --auth-ink-muted: #a8b4cc;
    --auth-ink-faint: #6f7d99;
    --auth-navy: #182038;
    --auth-navy-deep: #101828;
    --auth-navy-mid: #243048;
    --auth-gold: #f4b804;
    --auth-gold-strong: #f8c01c;
    --auth-gold-deep: #d99a00;
    --auth-blue-soft: #7aa2ff;
    --auth-glass-bg: rgba(16, 24, 40, 0.72);
    --auth-glass-border: rgba(244, 184, 4, 0.18);
    --auth-font-display: "Space Grotesk", "Avenir Next", system-ui, sans-serif;
    --auth-font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    margin: 0;
    min-height: 100vh;
    background: var(--auth-navy-deep);
    color: var(--auth-ink);
    font-family: var(--auth-font-body);
}

/* ---------- Layered background ---------- */

.auth-atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(36, 48, 72, 0.9), transparent 60%),
        radial-gradient(ellipse 55% 45% at 88% 88%, rgba(244, 184, 4, 0.1), transparent 60%),
        linear-gradient(180deg, #101828 0%, #182038 45%, #121a2c 100%);
}

.auth-atmosphere__glow {
    position: absolute;
    width: 58vw;
    height: 58vw;
    max-width: 880px;
    max-height: 880px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    will-change: transform;
}

.auth-atmosphere__glow--blue {
    top: -20%;
    left: -12%;
    background: radial-gradient(circle, rgba(36, 48, 72, 0.85), transparent 70%);
    animation: auth-glow-a 70s ease-in-out infinite alternate;
}

.auth-atmosphere__glow--amber {
    right: -18%;
    bottom: -24%;
    background: radial-gradient(circle, rgba(244, 184, 4, 0.22), transparent 70%);
    animation: auth-glow-b 88s ease-in-out infinite alternate;
}

.auth-atmosphere__scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.auth-atmosphere__bay path {
    fill: none;
    stroke: rgba(122, 162, 255, 0.12);
    stroke-width: 1;
    stroke-linecap: square;
}

.auth-atmosphere__route {
    fill: none;
    stroke: rgba(122, 162, 255, 0.28);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 3 14;
    animation: auth-route-flow 64s linear infinite;
}

.auth-atmosphere__route--2 {
    stroke: rgba(244, 184, 4, 0.32);
    stroke-width: 1.2;
    stroke-dasharray: 2 12;
    animation-duration: 86s;
    animation-direction: reverse;
}

.auth-atmosphere__route--3 {
    stroke: rgba(122, 162, 255, 0.16);
    stroke-width: 1;
    stroke-dasharray: 1.5 16;
    animation-duration: 110s;
}

.auth-atmosphere__parcel {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.auth-atmosphere__parcel rect:first-of-type {
    fill: rgba(245, 230, 190, 0.78);
    stroke: rgba(168, 180, 204, 0.55);
    stroke-width: 1.3;
}

.auth-atmosphere__parcel path {
    fill: none;
    stroke: rgba(244, 184, 4, 0.95);
    stroke-width: 2;
    stroke-linecap: round;
}

.auth-atmosphere__parcel .auth-atmosphere__label {
    fill: rgba(24, 32, 56, 0.7);
    stroke: none;
}

.auth-atmosphere__parcel--1 {
    offset-path: path("M -80 640 C 220 560, 420 700, 640 580 S 980 420, 1320 480");
    offset-rotate: auto 0deg;
    animation: auth-parcel-ride 42s linear infinite;
    scale: 1.55;
}

.auth-atmosphere__parcel--2 {
    offset-path: path("M -100 380 C 240 300, 480 460, 720 340 S 1040 200, 1340 280");
    offset-rotate: auto 0deg;
    animation: auth-parcel-ride 54s linear infinite;
    animation-delay: -18s;
    opacity: 0.92;
    scale: 1.35;
}

.auth-atmosphere__parcel--3 {
    offset-path: path("M -60 740 C 280 680, 560 780, 840 660 S 1160 540, 1380 600");
    offset-rotate: auto 0deg;
    animation: auth-parcel-ride 50s linear infinite;
    animation-delay: -8s;
    opacity: 0.88;
    scale: 1.45;
}

.auth-atmosphere__parcel--4 {
    offset-path: path("M -80 640 C 220 560, 420 700, 640 580 S 980 420, 1320 480");
    offset-rotate: auto 0deg;
    animation: auth-parcel-ride 42s linear infinite;
    animation-delay: -24s;
    opacity: 0.8;
    scale: 1.2;
}

.auth-atmosphere__parcel--5 {
    offset-path: path("M -100 380 C 240 300, 480 460, 720 340 S 1040 200, 1340 280");
    offset-rotate: auto 0deg;
    animation: auth-parcel-ride 54s linear infinite;
    animation-delay: -40s;
    opacity: 0.85;
    scale: 1.3;
}

.auth-atmosphere__grain {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: radial-gradient(rgba(255, 255, 255, 0.9) 0.55px, transparent 0.55px);
    background-size: 3px 3px;
}

.auth-atmosphere__vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 88% 68% at 50% 42%, transparent 52%, rgba(16, 24, 40, 0.78) 100%);
}

@keyframes auth-route-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -900; }
}

@keyframes auth-parcel-ride {
    from { offset-distance: 0%; }
    to { offset-distance: 100%; }
}

@keyframes auth-glow-a {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(5%, 4%) scale(1.07); }
}

@keyframes auth-glow-b {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-4%, -5%) scale(1.05); }
}

/* ---------- Layout shell ---------- */

.auth-atmosphere-page .auth-atmosphere-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 3rem;
}

/* ---------- Corner brand mark ---------- */

.auth-atmosphere-page .auth-corner-brand {
    position: fixed;
    top: max(1.25rem, env(safe-area-inset-top, 0px));
    left: max(1.25rem, env(safe-area-inset-left, 0px));
    z-index: 2;
    display: block;
    line-height: 0;
    border-radius: 22px;
    text-decoration: none;
}

.auth-atmosphere-page .auth-corner-brand:focus-visible {
    outline: 2px solid var(--auth-gold);
    outline-offset: 3px;
}

.auth-atmosphere-page .auth-corner-brand__logo {
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* ---------- Brand lockup ---------- */

.auth-atmosphere-page .auth-brand-lockup {
    text-align: center;
    margin-bottom: 1.5rem;
    max-width: 36rem;
    animation: auth-rise-in 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-atmosphere-page .auth-brand-heading {
    margin: 0 0 0.55rem;
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 4.5vw, 2.35rem);
    letter-spacing: 0.01em;
    color: var(--auth-ink);
    line-height: 1.1;
}

.auth-atmosphere-page .auth-brand-tagline {
    margin: 0;
    font-size: 1.05rem;
    color: var(--auth-ink-muted);
}

.auth-atmosphere-page .auth-brand-cursor {
    display: inline-block;
    margin-left: 0.12em;
    color: var(--auth-gold);
    animation: auth-blink 1.15s steps(2, jump-none) infinite;
}

/* ---------- Glass card ---------- */

.auth-atmosphere-page .card {
    width: 100%;
    background: var(--auth-glass-bg);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    border: 1px solid var(--auth-glass-border);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.45);
    color: var(--auth-ink);
    animation: auth-rise-in 760ms 110ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-atmosphere-page .card.card-inset {
    background: rgba(16, 24, 40, 0.5);
    border: 1px solid rgba(168, 180, 204, 0.14);
    box-shadow: none;
    animation: none;
}

.auth-atmosphere-page h1,
.auth-atmosphere-page h2,
.auth-atmosphere-page h3,
.auth-atmosphere-page h4 {
    color: var(--auth-ink);
}

.auth-atmosphere-page .text-muted {
    color: var(--auth-ink-muted);
}

.auth-atmosphere-page a {
    color: var(--auth-gold-strong);
}

.auth-atmosphere-page a:hover {
    color: #ffe08a;
}

.auth-atmosphere-page a:focus-visible,
.auth-atmosphere-page button:focus-visible {
    outline: 2px solid var(--auth-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Form controls ---------- */

.auth-atmosphere-page .form-group label {
    color: var(--auth-ink-muted);
    font-weight: 600;
}

.auth-atmosphere-page .form-group input,
.auth-atmosphere-page .form-group select,
.auth-atmosphere-page .form-group textarea {
    background: rgba(10, 14, 24, 0.55);
    border: 1px solid rgba(168, 180, 204, 0.28);
    color: var(--auth-ink);
    border-radius: 0.75rem;
    min-height: 48px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
}

.auth-atmosphere-page .form-group input[type="text"],
.auth-atmosphere-page .form-group input[type="email"],
.auth-atmosphere-page .form-group input:not([type]) {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.auth-atmosphere-page .form-group input::placeholder {
    color: var(--auth-ink-faint);
}

.auth-atmosphere-page .form-group input:focus,
.auth-atmosphere-page .form-group select:focus,
.auth-atmosphere-page .form-group textarea:focus {
    outline: none;
    border-color: var(--auth-gold);
    box-shadow: 0 0 0 3px rgba(244, 184, 4, 0.22);
}

.auth-atmosphere-page input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--auth-gold-deep);
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

/* ---------- Advanced setup disclosure (signup) ---------- */

.auth-atmosphere-page .auth-advanced {
    margin: 1.25rem 0 0;
    border-radius: 0.9rem;
    border: 1px solid rgba(168, 180, 204, 0.16);
    background: rgba(16, 24, 40, 0.4);
    overflow: hidden;
}

.auth-atmosphere-page .auth-advanced-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.75rem 1.1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--auth-ink-muted);
}

.auth-atmosphere-page .auth-advanced-summary::-webkit-details-marker {
    display: none;
}

.auth-atmosphere-page .auth-advanced-summary:hover {
    color: var(--auth-ink);
}

.auth-atmosphere-page .auth-advanced-summary:focus-visible {
    outline: 2px solid var(--auth-gold);
    outline-offset: -2px;
    border-radius: 0.6rem;
}

.auth-atmosphere-page .auth-advanced-summary-label {
    font-size: 0.95rem;
}

.auth-atmosphere-page .auth-advanced-chevron {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--auth-ink-faint);
    transition: transform 200ms ease;
}

.auth-atmosphere-page .auth-advanced[open] .auth-advanced-chevron {
    transform: rotate(180deg);
}

.auth-atmosphere-page .auth-advanced-body {
    padding: 0.25rem 1.1rem 1.1rem;
    display: grid;
    gap: 1.1rem;
}

.auth-atmosphere-page .auth-advanced-section-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.auth-atmosphere-page .auth-advanced-divider {
    height: 1px;
    margin: 0;
    background: rgba(168, 180, 204, 0.14);
}

.auth-atmosphere-page .auth-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

/* ---------- Buttons — clean gold, no neon circus ---------- */

.auth-atmosphere-page .btn {
    border-radius: 0.75rem;
    min-height: 48px;
    padding: 0.75rem 1.35rem;
    font-family: var(--auth-font-body);
    font-size: 1rem;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-atmosphere-page .btn-primary {
    width: 100%;
    background: var(--auth-gold);
    color: #101828;
    font-weight: 700;
    border: 0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 20px rgba(0, 0, 0, 0.28);
}

.auth-atmosphere-page .btn-primary:hover {
    background: var(--auth-gold-strong);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 10px 24px rgba(0, 0, 0, 0.32);
    transform: translateY(-1px);
}

.auth-atmosphere-page .btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 184, 4, 0.45), 0 8px 20px rgba(0, 0, 0, 0.28);
}

.auth-atmosphere-page .btn-primary:active {
    transform: translateY(0);
    background: var(--auth-gold-deep);
}

.auth-atmosphere-page .btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(168, 180, 204, 0.35);
    color: var(--auth-ink);
}

.auth-atmosphere-page .btn-secondary:hover {
    background: rgba(244, 184, 4, 0.1);
    border-color: rgba(244, 184, 4, 0.45);
}

/* ---------- Alerts ---------- */

.auth-atmosphere-page .alert {
    background: rgba(244, 184, 4, 0.1);
    border-left-color: var(--auth-gold);
    color: var(--auth-ink);
}

.auth-atmosphere-page .alert-error,
.auth-atmosphere-page .alert-danger {
    background: rgba(248, 113, 113, 0.14);
    border-left-color: #f87171;
    color: #ffe3e3;
}

.auth-atmosphere-page .alert-success {
    background: rgba(74, 222, 128, 0.14);
    border-left-color: #4ade80;
    color: #e6ffef;
}

.auth-atmosphere-page .alert-warning {
    background: rgba(250, 204, 21, 0.14);
    border-left-color: #facc15;
    color: #fff8e1;
}

@keyframes auth-rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes auth-blink {
    0%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-atmosphere__route,
    .auth-atmosphere__glow,
    .auth-atmosphere__parcel,
    .auth-atmosphere-page .auth-brand-lockup,
    .auth-atmosphere-page .card,
    .auth-atmosphere-page .auth-brand-cursor,
    .auth-atmosphere-page .btn,
    .auth-atmosphere-page .auth-advanced-chevron {
        animation: none !important;
        transition: none !important;
    }

    .auth-atmosphere__parcel--1 { offset-distance: 28%; }
    .auth-atmosphere__parcel--2 { offset-distance: 42%; }
    .auth-atmosphere__parcel--3 { offset-distance: 55%; }
    .auth-atmosphere__parcel--4 { offset-distance: 72%; }
    .auth-atmosphere__parcel--5 { offset-distance: 18%; }

    .auth-atmosphere-page .btn-primary:hover {
        transform: none;
    }
}

@media (max-width: 640px) {
    .auth-atmosphere-page .auth-atmosphere-shell {
        padding: 5.5rem 1rem 2rem;
    }

    .auth-atmosphere-page .auth-corner-brand {
        top: max(1rem, env(safe-area-inset-top, 0px));
        left: max(1rem, env(safe-area-inset-left, 0px));
    }

    .auth-atmosphere-page .auth-corner-brand__logo {
        width: 72px;
        height: 72px;
        border-radius: 18px;
    }
}
