:root {
    --bg-base: #0b0f1a;
    --bg-surface: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(99, 102, 241, 0.4);
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-muted: rgba(99, 102, 241, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --danger: #f87171;
    --success: #34d399;
    --warning: #fbbf24;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-primary);
    margin-bottom: 60px;
    -webkit-font-smoothing: antialiased;
}

/* Subtle dot grid background */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 32px 32px;
}

/* Navbar */
.navbar {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
}

.brand-icon {
    font-size: 1.1em;
    margin-right: 0.25rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem !important;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary) !important;
    background: var(--accent-muted);
}

/* Content area */
.content-wrapper {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Card widths */
.card-narrow {
    width: 100%;
    max-width: 550px;
}

.card-wide {
    width: 100%;
    max-width: 720px;
}

/* Cards */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 16px !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 80px -20px rgba(99, 102, 241, 0.08) !important;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.card:hover {
    border-color: var(--border-glow) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 80px -10px rgba(99, 102, 241, 0.15) !important;
}

.card-title {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.card-body {
    padding: 2rem !important;
}

/* Forms */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 10px !important;
    color: var(--text-primary) !important;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-muted) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    letter-spacing: -0.01em;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45) !important;
    opacity: 0.95;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--accent) !important;
    border-color: var(--accent) !important;
    border-radius: 10px !important;
    font-weight: 600;
    background: transparent !important;
    transition: background 0.2s, color 0.2s;
}

.btn-outline-primary:hover {
    background: var(--accent-muted) !important;
    color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #0b0f1a !important;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-danger {
    background: rgba(248, 113, 113, 0.12) !important;
    color: var(--danger) !important;
    border: 1px solid rgba(248, 113, 113, 0.2) !important;
}

.alert-success {
    background: rgba(52, 211, 153, 0.12) !important;
    color: var(--success) !important;
    border: 1px solid rgba(52, 211, 153, 0.2) !important;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.12) !important;
    color: var(--warning) !important;
    border: 1px solid rgba(251, 191, 36, 0.2) !important;
}

/* Text utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-danger {
    color: var(--danger) !important;
    font-size: 0.85rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-hover);
}

/* Dividers */
hr {
    border-color: var(--border-subtle);
    opacity: 1;
}

/* Footer */
.site-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.site-footer small {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* Select dropdown styling */
.form-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Focus ring override */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--accent-muted) !important;
    outline: none;
}

/* Password field specifics */
input[type="password"] {
    letter-spacing: 0.1em;
}

/* Validation select styling */
.form-select.is-invalid,
.form-control.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}
