:root,
[data-theme="light"] {
    font-size: 16px;
    color-scheme: light;
    --color-bg: #f4f7fa;
    --color-surface: #ffffff;
    --color-surface-raised: #ffffff;
    --color-text: #17232d;
    --color-muted: #667784;
    --color-border: #dce5eb;
    --color-primary: #0d7490;
    --color-primary-hover: #0a5f76;
    --color-danger: #ad332c;
    --color-danger-soft: #fff0ef;
    --shadow-panel: 0 12px 35px rgb(25 47 61 / 7%);
    --focus-ring: 0 0 0 4px rgb(13 116 144 / 16%);
    --auth-glow: rgb(13 116 144 / 14%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #0c1722;
    --color-surface: #142332;
    --color-surface-raised: #192b3c;
    --color-text: #eff6fa;
    --color-muted: #9db1bd;
    --color-border: #2b4050;
    --color-primary: #4ec3df;
    --color-primary-hover: #70d0e6;
    --color-danger: #ff918b;
    --color-danger-soft: #472524;
    --shadow-panel: 0 16px 45px rgb(0 0 0 / 22%);
    --focus-ring: 0 0 0 4px rgb(78 195 223 / 18%);
    --auth-glow: rgb(78 195 223 / 12%);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--color-text);
    background:
        radial-gradient(circle at 15% 10%, var(--auth-glow), transparent 28rem),
        var(--color-bg);
}

button,
input {
    font: inherit;
}

h1, h2, h3, h4, h5, h6,
strong,
b { font-weight: 600; }

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

.auth-card,
.dashboard-card {
    width: min(100%, 460px);
    padding: clamp(28px, 6vw, 48px);
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    background: var(--color-surface);
    box-shadow: var(--shadow-panel);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.auth-logo {
    display: block;
    width: min(100%, 330px);
    height: auto;
}

.intro,
.dashboard-card > p {
    margin: 0 0 28px;
    color: var(--color-muted);
    line-height: 1.6;
}

.alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    border: 1px solid var(--color-danger);
    border-radius: 0.25rem;
    color: var(--color-danger);
    background: var(--color-danger-soft);
    font-size: 0.9em;
}

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

label {
    margin-top: 8px;
    font-size: 0.875em;
    font-weight: 600;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    color: var(--color-text);
    background: var(--color-surface-raised);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

button {
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
    border: 0;
    border-radius: 0.25rem;
    color: #fff;
    background: var(--color-primary);
    cursor: pointer;
    font-weight: 600;
    transition: background 160ms ease, transform 160ms ease;
}

button:hover {
    background: var(--color-primary-hover);
}

button:active {
    transform: translateY(1px);
}

button.secondary {
    width: auto;
    padding-inline: 24px;
}

@media (max-width: 520px) {
    .auth-shell,
    .dashboard-shell {
        align-items: stretch;
        padding: 0;
    }

    .auth-card,
    .dashboard-card {
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0.25rem;
        box-shadow: none;
    }
}
