:root {
    color-scheme: dark;
    --primary: #0B1634;
    --primary-soft: #122451;
    --primary-bright: #1f4fff;
    --primary-bright-2: #143db3;
    --text-main: #ffffff;
    --text-soft: rgba(255, 255, 255, 0.64);
    --field-bg: rgba(255, 255, 255, 0.06);
    --field-border: rgba(255, 255, 255, 0.12);
    --field-focus: rgba(31, 79, 255, 0.44);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.1);
    --error-bg: rgba(255, 107, 107, 0.14);
    --error-text: #ffd0d0;
    --success-bg: rgba(80, 227, 194, 0.12);
    --success-text: #c7fff2;
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.55);
    --transition: 220ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Poppins", sans-serif;
}

body[data-page="login"] {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    color: var(--text-main);
    background: radial-gradient(circle at center, var(--primary-soft) 0%, var(--primary) 45%, #020617 100%);
}

.bubbles-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -160px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 35%;
    opacity: 0;
    transform: translateY(0) rotate(0deg);
    animation: rise linear infinite;
    animation-fill-mode: backwards;
    z-index: -1;
}

.bubble:nth-child(1) { left: 5%; width: 60px; height: 60px; animation-duration: 8s; animation-delay: 0s; }
.bubble:nth-child(2) { left: 15%; width: 100px; height: 100px; animation-duration: 12s; animation-delay: 2s; }
.bubble:nth-child(3) { left: 25%; width: 40px; height: 40px; animation-duration: 7s; animation-delay: 1s; }
.bubble:nth-child(4) { left: 35%; width: 120px; height: 120px; animation-duration: 15s; animation-delay: 3s; }
.bubble:nth-child(5) { left: 45%; width: 80px; height: 80px; animation-duration: 10s; animation-delay: 0s; }
.bubble:nth-child(6) { left: 55%; width: 150px; height: 150px; animation-duration: 18s; animation-delay: 5s; }
.bubble:nth-child(7) { left: 65%; width: 50px; height: 50px; animation-duration: 9s; animation-delay: 2s; }
.bubble:nth-child(8) { left: 75%; width: 90px; height: 90px; animation-duration: 13s; animation-delay: 4s; }
.bubble:nth-child(9) { left: 85%; width: 110px; height: 110px; animation-duration: 11s; animation-delay: 1s; }
.bubble:nth-child(10) { left: 92%; width: 70px; height: 70px; animation-duration: 10s; animation-delay: 6s; }
.bubble:nth-child(11) { left: 10%; width: 130px; height: 130px; animation-duration: 16s; animation-delay: 8s; }
.bubble:nth-child(12) { left: 30%; width: 55px; height: 55px; animation-duration: 9s; animation-delay: 7s; }
.bubble:nth-child(13) { left: 50%; width: 95px; height: 95px; animation-duration: 14s; animation-delay: 2s; }
.bubble:nth-child(14) { left: 70%; width: 45px; height: 45px; animation-duration: 8s; animation-delay: 5s; }
.bubble:nth-child(15) { left: 80%; width: 140px; height: 140px; animation-duration: 20s; animation-delay: 0s; }

.login-stage {
    width: 100%;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
}

.brand-header {
    margin-bottom: 10px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.brand-heading {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 0;
}

.brand-wordmark {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.brand-mark {
    width: 60px;
    height: auto;
    display: block;
    margin-right: -10px;
    transform: translateY(2px);
    filter: drop-shadow(0 8px 22px rgba(31, 79, 255, 0.24));
}

.brand-typewriter {
    display: inline-flex;
    align-items: flex-end;
    min-width: 4.25ch;
    min-height: 1em;
    font-size: 3rem;
    font-weight: 600;
    line-height: 0.9;
    letter-spacing: 0.04em;
}

.brand-support {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 30px;
}

.auth-form {
    display: grid;
    gap: 20px;
}

.field {
    text-align: left;
}

.field span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.78);
}

.field input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--field-border);
    background: var(--field-bg);
    color: var(--text-main);
    outline: none;
    transition: all var(--transition);
}

.field input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.field input:focus {
    border-color: rgba(31, 79, 255, 0.82);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px var(--field-focus);
}

.submit-button {
    width: 100%;
    min-height: 52px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-bright) 0%, var(--primary-bright-2) 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(31, 79, 255, 0.36);
    filter: brightness(1.08);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.8;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: none;
    animation: spin 0.9s linear infinite;
}

.submit-button.is-loading .spinner {
    display: inline-block;
}

.form-message {
    display: none;
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: left;
}

.form-message.is-visible {
    display: block;
}

.form-message.is-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid rgba(255, 149, 149, 0.18);
}

.form-message.is-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(80, 227, 194, 0.18);
}

body[data-page="dashboard"] {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    background: linear-gradient(180deg, #081126 0%, #0B1634 100%);
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.dashboard-card {
    width: min(100%, 520px);
    display: grid;
    gap: 22px;
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}

.meta-label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.dashboard-meta {
    display: grid;
    gap: 14px;
}

.dashboard-meta div {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.secondary-link {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

.secondary-link:hover {
    color: #ffffff;
}

.dashboard-actions {
    display: grid;
    gap: 14px;
}

@keyframes rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.4;
    }
    85% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-130vh) rotate(360deg);
        opacity: 0;
    }
}

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

@media (max-width: 480px) {
    .login-card {
        padding: 32px 22px;
        border-radius: 20px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .brand-mark {
        width: 52px;
        margin-right: -8px;
    }

    .brand-typewriter {
        min-width: 4.1ch;
        font-size: 2.5rem;
    }

    .brand-support {
        letter-spacing: 0.26em;
    }
}
