@font-face {
    font-family: 'Orbitron';
    src: url('/css/fonts/Orbitron.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SpaceMono';
    src: url('/css/fonts/SpaceMono.ttf') format('truetype');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #020206;
    --text: #e8e8ee;
    --text-dim: rgba(255, 255, 255, 0.35);
    --text-mid: rgba(255, 255, 255, 0.55);
    --accent: #a78bfa;
    --accent2: #38bdf8;
    --success: #4ade80;
    --error: #fb7185;
}

body {
    font-family: 'SpaceMono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

canvas#bg {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(2, 2, 6, 0.8) 100%);
    pointer-events: none;
}

.wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

/* Card */
.card {
    position: relative;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 48px 40px 40px;
    backdrop-filter: blur(50px) saturate(1.2);
    -webkit-backdrop-filter: blur(50px) saturate(1.2);
    overflow: hidden;
    animation: cardIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.4), transparent);
}

.card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    right: -20%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.06), transparent 70%);
    pointer-events: none;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.logo-wrap {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    position: relative;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.4));
}

.brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #c4b5fd, #818cf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Inputs */
.field {
    margin-bottom: 24px;
    position: relative;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px 8px 0 0;
    color: var(--text);
    font-size: 15px;
    font-family: 'SpaceMono', monospace;
    letter-spacing: 0.5px;
    outline: none;
    transition: all 0.3s ease;
}

/* Fix Chrome autofill white background */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.02) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-group input::placeholder {
    color: var(--text-dim);
    text-align: center;
}

.input-group input:focus {
    background: rgba(167, 139, 250, 0.04);
    border-bottom-color: var(--accent);
    box-shadow: 0 1px 0 0 var(--accent);
}

.input-group input.error {
    border-bottom-color: var(--error);
    background: rgba(251, 113, 133, 0.04);
    box-shadow: 0 1px 0 0 var(--error);
}

.field-msg {
    font-size: 11px;
    text-align: center;
    margin-top: 6px;
    color: var(--error);
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.25s ease;
}

.field-msg.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.field-msg.server-msg {
    margin-top: 14px;
    font-size: 12px;
}

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
    display: flex;
}

.pw-toggle:hover {
    color: var(--text-mid);
}

/* Options */
.options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-mid);
}

.check-label input {
    display: none;
}

.check-box {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.check-box svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.check-label input:checked~.check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.check-label input:checked~.check-box svg {
    opacity: 1;
    transform: scale(1);
}

.forgot {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot:hover {
    color: var(--text);
}

/* Button */
.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(56, 189, 248, 0.15));
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: 'SpaceMono', monospace;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent), #6366f1, var(--accent2));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn:hover {
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3), 0 0 60px rgba(167, 139, 250, 0.08);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled::before {
    opacity: 0;
}

.btn-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-label {
    transition: opacity 0.2s ease;
}

.btn.loading .btn-label {
    opacity: 0;
}

.btn .spinner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.7s linear infinite;
}

.btn.loading .spinner {
    opacity: 1;
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.overlay.show {
    opacity: 1;
    pointer-events: all;
}

.overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(2, 2, 6, 0.7);
    backdrop-filter: blur(8px);
}

.overlay-card {
    position: relative;
    z-index: 1;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 44px 36px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    backdrop-filter: blur(40px);
    transform: scale(0.9) translateY(12px);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.overlay.show .overlay-card {
    transform: scale(1) translateY(0);
}

.o-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-success .o-icon {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.st-error .o-icon {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.15);
}

.o-icon svg {
    width: 26px;
    height: 26px;
}

.st-success .o-icon svg {
    color: var(--success);
}

.st-error .o-icon svg {
    color: var(--error);
}

.o-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.st-success .o-title {
    color: var(--success);
}

.st-error .o-title {
    color: var(--error);
}

.o-text {
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.6;
    margin-bottom: 28px;
    font-weight: 300;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 101;
}

/* Responsive */
@media (max-width: 480px) {
    .wrapper {
        padding: 16px;
    }

    .card {
        padding: 36px 24px 32px;
        border-radius: 16px;
    }

    .brand {
        font-size: 17px;
        letter-spacing: 5px;
    }

    .overlay-card {
        padding: 36px 24px;
    }
}