/* ── Design System Variables ── */
:root {
    --color-bg-dark: #080d1a;
    --color-text-main: #dde2ea;
    --color-brand-blue: rgba(143, 170, 200, 0.45);
    --color-glow-blue: rgba(160, 185, 230, 0.11);

    --font-serif: "Cinzel", serif;
    --font-sans: "Inter", sans-serif;

    --animation-breathe-slow: vbreathe 9s ease-in-out infinite;
    --animation-breathe-fast: vbreathe 7s ease-in-out infinite;
}

/* ── Reset & Base Styles ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    overflow: hidden;
    font-family: var(--font-sans);
    background: var(--color-bg-dark);
}

/* ── Background & Ambient Effects ── */
.bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse 55% 50% at 50% 46%,
            var(--color-glow-blue) 0%,
            rgba(110, 140, 200, 0.05) 35%,
            transparent 65%
        ),
        radial-gradient(
            ellipse 65% 45% at 12% 8%,
            rgba(143, 170, 210, 0.05) 0%,
            transparent 55%
        ),
        linear-gradient(
            160deg,
            #0c1222 0%,
            #080c18 30%,
            #060a14 55%,
            #09101e 78%,
            #0e1526 100%
        );
}

.hairline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        135deg,
        transparent 0,
        transparent 80px,
        rgba(143, 170, 200, 0.025) 80px,
        rgba(143, 170, 200, 0.025) 81px
    );
}

.centerglow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 40% 35% at 50% 44%,
        rgba(180, 205, 240, 0.06) 0%,
        rgba(143, 170, 220, 0.03) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 2;
    animation: var(--animation-breathe-slow);
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 85% 80% at 50% 50%,
        transparent 45%,
        rgba(0, 0, 0, 0.45) 100%
    );
    animation: var(--animation-breathe-fast);
}

@keyframes vbreathe {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.shimmer {
    position: absolute;
    inset: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        105deg,
        transparent 38%,
        rgba(143, 170, 200, 0.04) 47%,
        rgba(143, 170, 200, 0.07) 50%,
        rgba(143, 170, 200, 0.04) 53%,
        transparent 62%
    );
    animation: shimsweep 14s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimsweep {
    0% {
        transform: translateX(-60%) translateY(-10%);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    38% {
        transform: translateX(30%) translateY(5%);
        opacity: 0;
    }
    100% {
        transform: translateX(30%) translateY(5%);
        opacity: 0;
    }
}

/* ── Borders & Outlines ── */
.frame {
    position: absolute;
    inset: 20px;
    pointer-events: none;
    z-index: 5;
}

.fc {
    position: absolute;
    overflow: hidden;
}

.fc svg {
    display: block;
}
.fc.tl {
    top: 0;
    left: 0;
}
.fc.tr {
    top: 0;
    right: 0;
    transform: scaleX(-1);
}
.fc.bl {
    bottom: 0;
    left: 0;
    transform: scaleY(-1);
}
.fc.br {
    bottom: 0;
    right: 0;
    transform: scale(-1, -1);
}

.fc path {
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: drawcorner 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.fc.tl path {
    animation-delay: 0.1s;
}
.fc.tr path {
    animation-delay: 0.25s;
}
.fc.bl path {
    animation-delay: 0.4s;
}
.fc.br path {
    animation-delay: 0.55s;
}

@keyframes drawcorner {
    to {
        stroke-dashoffset: 0;
    }
}

.border {
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(143, 170, 200, 0.12);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    animation: fadein 1s ease 0.8s forwards;
}

@keyframes fadein {
    to {
        opacity: 1;
    }
}

#astro {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
    z-index: 3;
}

/* ── Dust Particles Layout ── */
.dust {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.d {
    position: absolute;
    border-radius: 50%;
    background: rgba(143, 170, 200, 0.3);
    animation: dustfloat linear infinite;
}

@keyframes dustfloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--dx));
        opacity: 0;
    }
}

/* ── Typography & Interface UI ── */
.content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    width: 100%;
}

.eyebrow {
    font-size: clamp(9px, 1.2vw, 11px);
    font-weight: 200;
    letter-spacing: 8px;
    color: rgba(143, 170, 200, 0.55);
    text-transform: uppercase;
    margin-bottom: clamp(16px, 3vh, 26px);
    opacity: 0;
    animation: fadein 1s ease 1s forwards;
}

.wordmark {
    font-family: var(--font-serif);
    font-size: clamp(28px, 4vw, 54px);
    font-weight: 500;
    letter-spacing: clamp(4px, 0.8vw, 10px);
    line-height: 1;
    text-transform: uppercase;
    color: var(--color-text-main);
    text-align: center;
    animation:
        wglow 7s ease-in-out infinite,
        fadein 1s ease 1.1s both;
}

@keyframes wglow {
    0%,
    100% {
        text-shadow:
            0 0 20px rgba(180, 205, 240, 0.25),
            0 0 40px rgba(143, 170, 220, 0.12),
            0 1px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        text-shadow:
            0 0 30px rgba(180, 205, 240, 0.45),
            0 0 60px rgba(143, 170, 220, 0.22),
            0 1px 0 rgba(255, 255, 255, 1);
    }
}

.sep {
    color: rgba(143, 170, 200, 0.35);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0;
    margin: 0 6px;
    font-family: var(--font-serif);
}

.divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(143, 170, 200, 0.28),
        transparent
    );
    margin: clamp(16px, 2.8vh, 24px) auto;
    animation:
        divbreathe 6s ease-in-out infinite,
        fadein 1s ease 1.2s both;
}

@keyframes divbreathe {
    0%,
    100% {
        width: 48px;
        opacity: 0.7;
    }
    50% {
        width: 80px;
        opacity: 1;
    }
}

.sub {
    font-size: clamp(9px, 1.2vw, 11px);
    font-weight: 200;
    letter-spacing: 7px;
    color: rgba(143, 170, 200, 0.5);
    text-transform: uppercase;
    opacity: 0;
    animation: fadein 1s ease 1.3s forwards;
}

/* ── Login Portal Card ── */
.login {
    margin-top: clamp(20px, 3.5vh, 48px);
    width: min(260px, 72vw);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(143, 170, 200, 0.2);
    border-bottom-color: rgba(143, 170, 200, 0.14);
    border-right-color: rgba(143, 170, 200, 0.14);
    border-radius: 3px;
    padding: clamp(12px, 2vh, 20px) clamp(14px, 3vw, 20px)
        clamp(10px, 1.8vh, 16px);
    position: relative;
    box-shadow:
        0 4px 32px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(16px);
    opacity: 0;
    animation: fadein 1s ease 1.4s forwards;
}

.login::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(143, 170, 200, 0.25),
        transparent
    );
}

.lbl {
    font-size: clamp(9px, 1.2vw, 11px);
    font-weight: 200;
    letter-spacing: 5px;
    color: rgba(143, 170, 200, 0.45);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: clamp(8px, 1.2vh, 12px);
}

/* ── Interactive Buttons ── */
.gbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: clamp(8px, 1.4vh, 11px) 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(143, 170, 200, 0.32);
    border-radius: 2px;
    color: var(--color-text-main);
    font-family: var(--font-sans);
    font-size: clamp(11px, 1.5vw, 13px);
    font-weight: 300;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition:
        background 0.25s,
        box-shadow 0.25s,
        opacity 0.2s,
        transform 0.1s;
    box-shadow: 0 1px 4px rgba(80, 100, 130, 0.08);
}

.gbtn:hover:not(:disabled) {
    background: rgba(143, 170, 200, 0.14);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
}

.gbtn:active:not(:disabled) {
    transform: scale(0.99);
}

.gbtn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.gi {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(143, 170, 200, 0.14);
    border: 1px solid rgba(143, 170, 200, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #a8c4de;
    font-family: var(--font-serif);
    flex-shrink: 0;
}

/* ── Footer Branding ── */
.byline {
    position: absolute;
    bottom: clamp(16px, 3vh, 28px);
    left: 0;
    right: 0;
    text-align: center;
    font-size: clamp(7px, 0.9vw, 9px);
    font-weight: 200;
    letter-spacing: 5px;
    color: rgba(143, 170, 200, 0.35);
    text-transform: uppercase;
    z-index: 10;
    opacity: 0;
    animation: fadein 1.2s ease 1.8s forwards;
}

.byline .sep {
    color: rgba(143, 170, 200, 0.25);
    margin: 0 8px;
}

.byline a {
    color: rgba(143, 170, 200, 0.75);
    text-decoration: none;
    border-bottom: 1px solid rgba(143, 170, 200, 0.3);
    padding-bottom: 1px;
    transition:
        color 0.2s,
        border-color 0.2s;
}

.byline a:hover {
    color: rgba(143, 170, 200, 1);
    border-bottom-color: rgba(143, 170, 200, 0.7);
}

/* ── Mobile Layout Shifts ── */
@media (max-width: 480px) {
    .login {
        width: 72vw;
        padding: 12px 14px 10px;
    }
    .lbl {
        font-size: 7px;
        margin-bottom: 8px;
    }
    .gbtn {
        padding: 8px 10px;
        font-size: 11px;
        gap: 6px;
    }
    .gi {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }
}
