/* ========================================================================== */
/* Appwrite Cloud Authentication Gate — LearningCali Redesign                 */
/* ========================================================================== */

.auth-observatory {
    padding: 32px 16px;
    background: #080c14;
    animation: none;
}

.auth-observatory::before,
.auth-observatory::after {
    display: none;
}

/* Atmospheric Cosmic Sky Background */
.access-sky {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 115%, rgba(253, 54, 110, 0.18) 0%, transparent 60%),
        radial-gradient(circle at 15% 25%, rgba(124, 58, 237, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(56, 189, 248, 0.1) 0%, transparent 50%),
        #070b13;
}

.access-aurora {
    position: absolute;
    inset: -30%;
    opacity: 0.75;
    background: conic-gradient(
        from 65deg at 50% 50%,
        transparent 0deg,
        rgba(253, 54, 110, 0.35) 55deg,
        rgba(255, 78, 133, 0.42) 90deg,
        rgba(139, 92, 246, 0.3) 140deg,
        transparent 195deg,
        rgba(14, 165, 233, 0.2) 260deg,
        transparent 320deg
    );
    filter: blur(70px);
    animation: appwrite-aurora 24s ease-in-out infinite alternate;
    transition: opacity 1s ease;
}

.access-orbits {
    position: absolute;
    width: min(1180px, 150vw);
    aspect-ratio: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.access-orbits i {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(253, 54, 110, 0.14);
    border-radius: 50%;
    animation: appwrite-orbit 55s linear infinite;
}

.access-orbits i:nth-child(2) {
    inset: 13%;
    animation-duration: 38s;
    animation-direction: reverse;
    border: 1px dashed rgba(168, 85, 247, 0.22);
    opacity: 0.75;
}

.access-orbits i:nth-child(3) {
    inset: 24%;
    animation-duration: 28s;
    border-color: rgba(255, 78, 133, 0.16);
}

.access-orbits i::before {
    content: '';
    position: absolute;
    top: 14.5%;
    left: 14.5%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FD366E;
    box-shadow: 0 0 16px #FF4E85, 0 0 30px rgba(253, 54, 110, 0.8);
}

.access-orbits i:nth-child(2)::before {
    background: #A855F7;
    box-shadow: 0 0 16px #C084FC, 0 0 28px rgba(168, 85, 247, 0.8);
}

.access-horizon {
    position: absolute;
    width: 140%;
    height: 55%;
    bottom: -38%;
    left: -20%;
    border-radius: 50%;
    border-top: 1px solid rgba(253, 54, 110, 0.45);
    box-shadow: 0 -16px 80px rgba(253, 54, 110, 0.2), 0 -4px 30px rgba(168, 85, 247, 0.15);
}

/* Glassmorphic Auth Panel */
.access-panel {
    position: relative;
    width: min(35rem, 100%);
    padding: 20px 20px 16px;
    border: 1px solid rgba(253, 54, 110, 0.25);
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(17, 24, 39, 0.9) 0%, rgba(10, 15, 26, 0.95) 100%);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.75),
        0 0 80px rgba(253, 54, 110, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.access-panel:hover {
    border-color: rgba(253, 54, 110, 0.38);
    box-shadow:
        0 28px 72px rgba(0, 0, 0, 0.8),
        0 0 95px rgba(253, 54, 110, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Header Row with Appwrite Badge & Config Button */
.access-cloud-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.access-cloud-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px 4px 9px;
    margin-bottom: 0;
    border: 1px solid rgba(253, 54, 110, 0.32);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(253, 54, 110, 0.12), rgba(139, 92, 246, 0.08));
    font: 600 10px/1.3 Inter, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FDA4AF;
    box-shadow: 0 2px 10px rgba(253, 54, 110, 0.15);
}

.auth-config-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid rgba(253, 54, 110, 0.22);
    border-radius: 8px;
    background: rgba(8, 14, 25, 0.7);
    color: #94A3B8;
    font: 500 11px/1 Inter, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-config-toggle:hover {
    color: #FDA4AF;
    border-color: rgba(253, 54, 110, 0.45);
    background: rgba(253, 54, 110, 0.1);
}

.auth-config-drawer {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid rgba(253, 54, 110, 0.3);
    border-radius: 12px;
    background: rgba(6, 11, 20, 0.9);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
    animation: fadeInDrawer 0.2s ease;
}

@keyframes fadeInDrawer {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-config-label {
    display: block;
    margin-bottom: 6px;
    font: 600 11px/1.2 Inter, sans-serif;
    color: #FDA4AF;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-config-input-wrap {
    display: flex;
    gap: 8px;
}

.auth-config-input-wrap input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(253, 54, 110, 0.35);
    border-radius: 8px;
    background: rgba(10, 16, 28, 0.9);
    color: #FFFFFF;
    font: 500 13px/1 Inter, monospace;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-config-input-wrap input:focus {
    border-color: #FD366E;
    box-shadow: 0 0 0 2px rgba(253, 54, 110, 0.25);
}

.auth-config-select {
    width: 100%;
    height: 34px;
    margin-bottom: 2px;
    padding: 0 8px;
    border: 1px solid rgba(253, 54, 110, 0.35);
    border-radius: 8px;
    background: #0a101c;
    color: #F8FAFC;
    font: 500 12px/1.3 Inter, sans-serif;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.auth-config-select:focus {
    border-color: #FD366E;
    box-shadow: 0 0 0 2px rgba(253, 54, 110, 0.25);
}

.auth-config-save-btn {
    padding: 0 14px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #FD366E, #F43F5E);
    color: #FFFFFF;
    font: 600 12px/1 Inter, sans-serif;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.auth-config-save-btn:hover {
    transform: scale(1.03);
}

.auth-config-hint {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #94A3B8;
}

.auth-config-hint a {
    color: #FD366E;
    text-decoration: underline;
}

.auth-config-hint code {
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(253, 54, 110, 0.15);
    color: #FDA4AF;
    font-size: 10.5px;
}

.access-cloud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FD366E;
    box-shadow: 0 0 8px #FF4E85;
    animation: appwrite-beacon 2s ease-in-out infinite;
}

/* Header & Emblem */
.access-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0 2px 14px;
}

.access-emblem {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    margin: 0;
    border: 1px solid rgba(253, 54, 110, 0.4);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(253, 54, 110, 0.18), rgba(139, 92, 246, 0.14));
    box-shadow: 0 4px 20px rgba(253, 54, 110, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.access-panel:hover .access-emblem {
    transform: rotate(6deg) scale(1.04);
    box-shadow: 0 6px 24px rgba(253, 54, 110, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.access-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.access-kicker {
    margin: 0;
    color: #FD366E;
    font: 600 10px/1.2 Inter, sans-serif;
    letter-spacing: 0.16em;
    text-shadow: 0 0 12px rgba(253, 54, 110, 0.3);
}

.access-panel #auth-title {
    margin: 0;
    font: 600 1.25rem/1.2 Inter, sans-serif;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #FFFFFF 65%, #FECDD3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.access-panel #auth-subtitle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Interactive Capsule Track */
.access-panel .auth-bar-track {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0;
    width: 100%;
    min-height: 48px;
    padding: 5px 5px 5px 14px;
    overflow: hidden;
    border: 1px solid rgba(253, 54, 110, 0.26);
    border-radius: 999px;
    background: rgba(8, 14, 25, 0.85);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.45),
        0 4px 16px rgba(0, 0, 0, 0.2);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.access-panel .auth-bar-track:focus-within {
    border-color: rgba(253, 54, 110, 0.75);
    box-shadow:
        0 0 0 3px rgba(253, 54, 110, 0.22),
        0 8px 24px -4px rgba(253, 54, 110, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.access-panel .auth-bar-track::before,
.access-panel .auth-bar-track::after,
.access-panel .auth-bar-sheen,
.access-panel .auth-bar-focus {
    display: none;
}

/* Fields & Inputs */
.access-panel .auth-bar-field {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    width: auto;
    min-width: 0;
    min-height: 38px;
    margin: 0;
    padding: 0 6px 0 0;
    border: 0;
    border-radius: 0;
    color: #94A3B8;
    background: transparent;
    box-shadow: none;
    transition: color 0.2s ease;
}

.access-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.access-panel .auth-bar-field:focus-within {
    color: #FDA4AF;
}

.access-panel .auth-bar-field > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    transition: transform 0.2s ease, color 0.2s ease;
}

.access-panel .auth-bar-field:focus-within > svg {
    color: #FD366E;
    transform: scale(1.1);
}

.access-panel .auth-bar-field input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    color: #F8FAFC;
    background: transparent;
    font: 500 15px/1.3 Inter, sans-serif;
    letter-spacing: -0.01em;
}

.access-panel .auth-bar-field input::placeholder {
    color: #64748B;
    font-size: 13.5px;
    font-weight: 400;
}

.access-panel .auth-bar-rule {
    display: block;
    z-index: 1;
    width: 1px;
    height: 20px;
    margin: 0 6px;
    background: linear-gradient(180deg, transparent, rgba(253, 54, 110, 0.35), transparent);
}

.access-panel .auth-password-toggle {
    width: 30px;
    height: 32px;
    color: #94A3B8;
    flex: 0 0 auto;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.access-panel .auth-password-toggle:hover {
    color: #FDA4AF;
    background: rgba(253, 54, 110, 0.12);
}

/* Appwrite Coral Submit Button */
.access-panel .auth-submit {
    position: relative;
    z-index: 1;
    left: auto;
    top: auto;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #FD366E 0%, #FF4884 55%, #EF1B5B 100%);
    color: #FFFFFF;
    font: 600 13px/1.4 Inter, sans-serif;
    clip-path: none;
    animation: none;
    box-shadow:
        0 4px 18px rgba(253, 54, 110, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
}

.access-submit-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.access-panel .auth-submit svg {
    width: 17px;
    height: 17px;
    margin: 0;
    transition: transform 0.2s ease;
}

.access-panel .auth-submit:hover {
    transform: scale(1.06);
    background: linear-gradient(135deg, #FF4884 0%, #FD366E 60%, #F43F5E 100%);
    box-shadow:
        0 6px 26px rgba(253, 54, 110, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.access-panel .auth-submit:hover svg {
    transform: translateX(2px);
}

.access-panel .auth-submit:active {
    transform: scale(0.96);
}

.access-panel .auth-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(253, 54, 110, 0.25);
}

/* Status messages */
.access-panel .auth-login-status {
    position: static;
    min-height: 18px;
    margin: 10px 4px 0;
    text-align: left;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    color: #94A3B8;
    transition: color 0.2s ease;
}

.access-panel .auth-login-status.is-error {
    color: #FCA5A5;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.access-panel .auth-login-status.is-success {
    color: #86EFAC;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

/* Atmospheric Footer */
.auth-observatory .auth-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: rgba(253, 54, 110, 0.65);
    font: 600 9.5px/1.5 Inter, sans-serif;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    transform: none;
    white-space: normal;
}

.auth-footer-sep {
    font-size: 7px;
    opacity: 0.6;
    color: #FD366E;
}

/* Connecting State Animations */
.auth-observatory.is-connecting .access-aurora {
    opacity: 1;
    animation-duration: 12s;
}

.auth-observatory.is-connecting .access-orbits {
    animation: appwrite-breathe 2.2s ease-in-out infinite;
}

.auth-observatory.is-connecting .access-emblem {
    animation: appwrite-orbit 2.5s linear infinite;
}

.auth-observatory.is-connecting .access-panel .auth-submit {
    animation: appwrite-pulse-glow 1.5s infinite alternate;
}

body.authenticated .auth-observatory,
body.authenticated .auth-observatory * {
    animation-play-state: paused;
}

/* Keyframes */
@keyframes appwrite-orbit {
    to { transform: rotate(360deg); }
}

@keyframes appwrite-aurora {
    from { transform: rotate(-25deg) scale(1); }
    to { transform: rotate(30deg) scale(1.18); }
}

@keyframes appwrite-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.9; }
}

@keyframes appwrite-beacon {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes appwrite-pulse-glow {
    0% { box-shadow: 0 0 15px rgba(253, 54, 110, 0.4); }
    100% { box-shadow: 0 0 35px rgba(253, 54, 110, 0.85); }
}

/* Responsive Styles */
@media (max-width: 580px) {
    .auth-observatory {
        padding: 24px 14px;
    }

    .access-panel {
        padding: 16px 14px 14px;
        border-radius: 18px;
    }

    .access-panel .auth-bar-track {
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: 0;
        padding: 10px;
        border-radius: 16px;
    }

    .access-panel .auth-bar-rule {
        display: none;
    }

    .access-panel .auth-bar-field {
        width: 100%;
        min-height: 44px;
        padding: 0 12px;
        border: 1px solid rgba(253, 54, 110, 0.25);
        border-radius: 12px;
        background: rgba(6, 11, 20, 0.65);
    }

    .access-panel .auth-bar-field input {
        height: 42px;
    }

    .access-panel .auth-submit {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 18px;
        border-radius: 12px;
    }

    .access-submit-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: nowrap;
        font-weight: 600;
        letter-spacing: 0.02em;
    }
}

@media (max-height: 640px) {
    .auth-observatory {
        place-items: start center;
    }

    .auth-observatory .auth-footer {
        position: relative;
        margin-top: 24px;
        bottom: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-observatory *,
    .access-aurora,
    .access-orbits i {
        animation: none !important;
        transition: none !important;
    }
}

/* Full-screen gradient overlay; sign-in card stays in the left footer */
body.auth-pending {
    overflow: hidden;
}

body.auth-pending > :not(.auth-gate):not(.scanlines-overlay) {
    visibility: hidden;
    pointer-events: none;
}

body.auth-pending .scanlines-overlay {
    display: none !important;
}

#auth-gate.auth-dock {
    inset: 0;
    z-index: 10000;
    display: block;
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
    color: #f8fafc;
    pointer-events: auto;
    isolation: isolate;
    background:
        radial-gradient(ellipse 80% 60% at 12% 88%, rgba(253, 54, 110, 0.38) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 88% 12%, rgba(99, 102, 241, 0.42) 0%, transparent 52%),
        radial-gradient(ellipse 55% 45% at 48% 42%, rgba(14, 165, 233, 0.22) 0%, transparent 58%),
        linear-gradient(155deg, #0b1220 0%, #1e1b4b 42%, #4c1d4b 72%, #0f172a 100%);
}

#auth-gate.auth-dock::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 28%),
        linear-gradient(90deg, rgba(15, 23, 42, 0.2) 0%, transparent 40%);
}

#auth-gate.auth-dock::after {
    content: '';
    position: absolute;
    inset: auto -20% -35% -20%;
    z-index: 0;
    height: 70%;
    pointer-events: none;
    background: radial-gradient(ellipse at 20% 0%, rgba(253, 54, 110, 0.28), transparent 58%);
    filter: blur(8px);
}

#auth-gate.auth-dock .access-sky,
#auth-gate.auth-dock .auth-footer {
    display: none;
}

#auth-gate.auth-dock .access-panel {
    position: absolute;
    left: max(36px, env(safe-area-inset-left, 0px));
    bottom: max(88px, calc(env(safe-area-inset-bottom, 0px) + 52px));
    z-index: 1;
    pointer-events: auto;
    width: min(38rem, calc(100vw - 72px));
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.46) 0%, rgba(15, 23, 42, 0.28) 100%);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

#auth-gate.auth-dock .access-panel:hover {
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#auth-gate.auth-dock .access-head,
#auth-gate.auth-dock .access-panel #auth-subtitle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#auth-gate.auth-dock .access-panel .auth-bar-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    min-height: 44px;
    padding: 0 4px 0 10px;
    overflow: visible;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

#auth-gate.auth-dock .access-panel .auth-bar-track:focus-within {
    border: 0;
    box-shadow: none;
}

#auth-gate.auth-dock .access-panel .auth-bar-rule {
    display: block;
    width: 1px;
    height: 18px;
    margin: 0 8px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}

#auth-gate.auth-dock .access-panel .auth-bar-field {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 0 4px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(226, 232, 240, 0.78);
}

#auth-gate.auth-dock .access-panel .auth-bar-field:focus-within {
    color: #fff;
    background: transparent;
    border-color: transparent;
}

#auth-gate.auth-dock .access-panel .auth-bar-field input {
    height: 40px;
    font-size: 14px;
    color: #f8fafc;
}

#auth-gate.auth-dock .access-panel .auth-bar-field input::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

#auth-gate.auth-dock .access-panel .auth-submit {
    flex: 0 0 auto;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    background: rgba(253, 54, 110, 0.88);
    box-shadow: 0 4px 16px rgba(253, 54, 110, 0.28);
}

#auth-gate.auth-dock .access-submit-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#auth-gate.auth-dock .access-panel .auth-login-status {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(100% + 14px);
    margin: 0;
    min-height: 0;
    text-align: left;
    color: rgba(226, 232, 240, 0.86);
    font-size: 12.5px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

#auth-gate.auth-dock .access-panel .auth-login-status:empty {
    display: none;
}

#auth-gate.auth-dock.is-connecting .access-panel .auth-submit {
    animation: none;
    opacity: 0.8;
}

body.authenticated #auth-gate.auth-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#auth-gate.auth-dock .auth-geometry {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

#auth-gate.auth-dock .auth-geo-floor {
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: -18%;
    height: 62%;
    background-image:
        linear-gradient(rgba(253, 54, 110, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 140, 248, 0.14) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: perspective(720px) rotateX(64deg);
    transform-origin: 50% 0%;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 88%);
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 88%);
    animation: auth-geo-grid 28s linear infinite;
}

#auth-gate.auth-dock .auth-geo-mesh {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(circle at 70% 32%, rgba(253, 54, 110, 0.16), transparent 28%),
        repeating-conic-gradient(from 0deg at 68% 38%, transparent 0 14deg, rgba(99, 102, 241, 0.05) 14deg 15deg);
    animation: auth-geo-mesh 36s linear infinite;
    opacity: 0.7;
}

#auth-gate.auth-dock .auth-geo-stage {
    position: absolute;
    top: 42%;
    left: 62%;
    width: min(72vmin, 540px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
}

#auth-gate.auth-dock .auth-geo-orbit {
    position: absolute;
    inset: 6%;
    border: 1px solid rgba(253, 54, 110, 0.22);
    border-radius: 50%;
    animation: auth-geo-spin 48s linear infinite;
}

#auth-gate.auth-dock .auth-geo-orbit--a {
    border-color: rgba(253, 54, 110, 0.28);
    border-top-color: rgba(253, 54, 110, 0.7);
    border-right-color: transparent;
}

#auth-gate.auth-dock .auth-geo-orbit--b {
    inset: 16%;
    border-color: rgba(129, 140, 248, 0.2);
    border-bottom-color: rgba(56, 189, 248, 0.65);
    border-left-color: transparent;
    animation-duration: 34s;
    animation-direction: reverse;
}

#auth-gate.auth-dock .auth-geo-orbit--c {
    inset: 27%;
    border-radius: 18%;
    border-color: rgba(167, 139, 250, 0.18);
    transform: rotate(18deg);
    animation-duration: 22s;
}

#auth-gate.auth-dock .auth-geo-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

#auth-gate.auth-dock .auth-geo-hex {
    stroke: rgba(253, 54, 110, 0.72);
    stroke-width: 1.4;
    animation: auth-geo-spin 52s linear infinite;
    transform-origin: center;
    transform-box: fill-box;
}

#auth-gate.auth-dock .auth-geo-hex--inner {
    stroke: rgba(129, 140, 248, 0.5);
    stroke-width: 1;
    animation-duration: 38s;
    animation-direction: reverse;
}

#auth-gate.auth-dock .auth-geo-tri {
    stroke: rgba(56, 189, 248, 0.48);
    stroke-width: 1.1;
    animation: auth-geo-pulse 7s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

#auth-gate.auth-dock .auth-geo-tri--inv {
    stroke: rgba(167, 139, 250, 0.42);
    animation-delay: -3.4s;
}

#auth-gate.auth-dock .auth-geo-diamond {
    stroke: rgba(253, 54, 110, 0.55);
    stroke-width: 1.1;
    animation: auth-geo-spin 26s linear infinite reverse;
    transform-origin: center;
    transform-box: fill-box;
}

#auth-gate.auth-dock .auth-geo-svg circle {
    fill: #fda4af;
    filter: drop-shadow(0 0 6px rgba(253, 54, 110, 0.8));
}

#auth-gate.auth-dock .auth-geo-svg path {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 0.8;
}

#auth-gate.auth-dock .auth-geo-shard {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(253, 54, 110, 0.45);
    background: rgba(253, 54, 110, 0.08);
    transform: rotate(45deg);
    animation: auth-geo-float 11s ease-in-out infinite;
}

#auth-gate.auth-dock .auth-geo-shard:nth-child(4) { top: 14%; left: 18%; animation-delay: -1s; }
#auth-gate.auth-dock .auth-geo-shard:nth-child(5) { top: 22%; right: 14%; width: 12px; height: 12px; animation-delay: -4s; border-color: rgba(129, 140, 248, 0.5); }
#auth-gate.auth-dock .auth-geo-shard:nth-child(6) { top: 48%; left: 8%; width: 10px; height: 10px; animation-delay: -2.5s; border-radius: 50%; }
#auth-gate.auth-dock .auth-geo-shard:nth-child(7) { bottom: 28%; right: 18%; animation-delay: -6s; border-color: rgba(56, 189, 248, 0.5); }
#auth-gate.auth-dock .auth-geo-shard:nth-child(8) { bottom: 18%; left: 42%; width: 14px; height: 14px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: transparent; border-color: rgba(167, 139, 250, 0.55); animation-delay: -3s; }
#auth-gate.auth-dock .auth-geo-shard:nth-child(9) { top: 36%; right: 8%; width: 22px; height: 22px; animation-delay: -8s; }

#auth-gate.auth-dock.is-connecting .auth-geo-orbit,
#auth-gate.auth-dock.is-connecting .auth-geo-hex,
#auth-gate.auth-dock.is-connecting .auth-geo-diamond {
    animation-duration: 8s;
}

#auth-gate.auth-dock.is-connecting .auth-geo-floor {
    animation-duration: 10s;
    opacity: 1;
    filter: drop-shadow(0 0 18px rgba(253, 54, 110, 0.25));
}

#auth-gate.auth-dock.is-connecting .auth-geo-stage {
    filter: drop-shadow(0 0 28px rgba(253, 54, 110, 0.28));
}

#auth-gate.auth-dock.is-connecting .auth-geo-svg circle {
    animation: auth-geo-node 1.1s ease-in-out infinite;
}

@keyframes auth-geo-spin {
    to { transform: rotate(360deg); }
}

@keyframes auth-geo-grid {
    from { background-position: 0 0; }
    to { background-position: 0 56px; }
}

@keyframes auth-geo-mesh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes auth-geo-pulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.04); }
}

@keyframes auth-geo-float {
    0%, 100% { translate: 0 0; opacity: 0.45; }
    50% { translate: 0 -12px; opacity: 0.9; }
}

@keyframes auth-geo-node {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@media (max-width: 580px) {
    #auth-gate.auth-dock .access-panel {
        left: max(18px, env(safe-area-inset-left, 0px));
        bottom: max(56px, calc(env(safe-area-inset-bottom, 0px) + 36px));
        width: min(38rem, calc(100vw - 36px));
    }

    #auth-gate.auth-dock .access-panel .auth-bar-field > svg {
        display: none;
    }

    #auth-gate.auth-dock .auth-geo-stage {
        top: 38%;
        left: 50%;
        width: min(88vmin, 420px);
    }

    #auth-gate.auth-dock .auth-geo-shard:nth-child(n+7) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #auth-gate.auth-dock .auth-geometry *,
    #auth-gate.auth-dock .auth-geo-floor,
    #auth-gate.auth-dock .auth-geo-mesh {
        animation: none !important;
        transition: none !important;
    }
}
