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

:root {
    --bg:          #07080f;
    --surface:     #0e1016;
    --border:      rgba(255, 255, 255, 0.07);
    --accent:      #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --text:        #f1f5f9;
    --text-dim:    #94a3b8;
    --muted:       #475569;
    --error:       #f87171;
    --success:     #34d399;
    --warning:     #60a5fa;
}

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -5%, rgba(59, 130, 246, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 100% 100%, 28px 28px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth pages ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-top-color: rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 32px 80px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.auth-brand::after {
    content: '_';
    color: var(--accent);
    animation: blink 1.2s step-end infinite;
}

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

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes border-spin {
    to { --angle: 360deg; }
}

/* ── Rotating glow wrapper ── */
.auth-glow {
    position: relative;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
}

.auth-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: conic-gradient(
        from var(--angle),
        transparent 0%,
        transparent 91%,
        rgba(147, 197, 253, 0.4) 95%,
        rgba(219, 234, 254, 0.85) 97.5%,
        rgba(147, 197, 253, 0.4) 99.5%,
        transparent 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: border-spin 18s linear infinite;
    pointer-events: none;
    z-index: 2;
}

.auth-glow .auth-card {
    position: relative;
    z-index: 1;
    max-width: none;
}

.auth-title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 24px;
    text-align: center;
}

.auth-hint {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.6;
}

.auth-back {
    margin-top: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── Alerts ── */
.alert {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    line-height: 1.5;
}
.alert-error   { background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.2); color: var(--error); }
.alert-warning { background: rgba(96,  165, 250, 0.08); border: 1px solid rgba(96,  165, 250, 0.2); color: var(--warning); }
.alert-success { background: rgba(52,  211, 153, 0.08); border: 1px solid rgba(52,  211, 153, 0.2); color: var(--success); }

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    padding: 11px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input::placeholder { color: var(--muted); }

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#code {
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-size: 1.75rem;
    letter-spacing: 0.35em;
    padding: 14px;
}

/* ── Buttons ── */
.btn-primary {
    display: block;
    width: 100%;
    background: rgba(59, 130, 246, 0.15);
    color: rgba(147, 197, 253, 0.9);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn-primary:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
}
.btn-primary:active { transform: scale(0.99); }

/* ── Dashboard ── */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 8, 15, 0.8);
    border-bottom: 1px solid var(--border);
    padding: 14px 32px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(16px);
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 14px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    text-decoration: none;
}
.btn-logout:hover { border-color: var(--error); color: var(--error); text-decoration: none; }

.dashboard-main {
    max-width: 960px;
    margin: 56px auto;
    padding: 0 24px;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 12px;
}

.dashboard-hint {
    color: var(--text-dim);
    font-size: 0.95rem;
}
