/* ============================================================
   Global stylesheet: design tokens + base styles ONLY.
   Component-specific styles belong in <Component>.razor.css.
   ============================================================ */

:root {
    --bg-base: #0b0e14;
    --bg-elevated: #141927;
    --border: #232b3d;
    --text-primary: #e6e9ef;
    --text-secondary: #9aa3b2;
    --accent: #7c5cff;
    --accent-soft: #a78bfa;
    --accent-alt: #2dd4bf;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-base);
    background-image:
        radial-gradient(900px 620px at 85% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
        radial-gradient(820px 600px at -10% 105%, rgba(45, 212, 191, 0.10), transparent 60%),
        radial-gradient(640px 420px at 50% 45%, rgba(124, 92, 255, 0.05), transparent 70%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1:focus {
    outline: none;
}

a {
    color: var(--accent-soft);
}

/* ---------- Startup loading screen ---------- */

.app-loading {
    display: grid;
    place-items: center;
    gap: 1rem;
    min-height: 100vh;
    align-content: center;
    color: var(--text-secondary);
}

.app-loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    animation: app-loading-spin 0.9s linear infinite;
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.6rem 1.25rem 0.7rem;
    background: #3b1d2a;
    color: var(--text-primary);
    border-top: 1px solid #6b2138;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.4);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.55rem 1.15rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.btn:hover {
    border-color: var(--accent);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.primary:hover {
    background: #6b4cf0;
}

.btn.ghost {
    background: transparent;
}

.btn.google {
    background: #fff;
    color: #1f2330;
    border-color: #fff;
}

.btn.google:hover {
    background: #ececf1;
    border-color: #ececf1;
}

.btn.block {
    width: 100%;
}

.btn.small {
    min-height: 36px;
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
}

/* ---------- forms & auth cards ---------- */

.auth-shell {
    max-width: 26rem;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

.auth-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.auth-card h1 {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
}

.auth-card .sub {
    margin: 0 0 1.4rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--bg-base);
    color: var(--text-primary);
    font: inherit;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
}

.field-errors {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.field-errors li {
    color: #fca5a5;
    font-size: 0.82rem;
}

.form-error {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 9px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.form-success {
    color: #6ee7b7;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 9px;
    padding: 0.85rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.auth-links a {
    color: var(--accent-soft);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.stack-gap {
    margin-top: 1rem;
}
