:root {
    --ink: var(--theme-text, #1a2b35);
    --bg: var(--theme-background, #edeae3);
    --card: var(--theme-surface, #f5f2eb);
    --line: var(--theme-border, #ccc9be);
    --brand: var(--theme-accent, #2d6a5a);
    --brand-dark: var(--theme-primary_dark, #16242d);
    --muted: var(--theme-muted_text, #6b7280);
    --danger: var(--theme-danger, #b94040);
    --accent-pale: var(--theme-accent_pale, #d3e8e3);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top right, var(--accent-pale) 0%, var(--bg) 58%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-topbar {
    padding: 1rem 1.25rem 0;
}

.auth-home-link {
    display: inline-flex;
    align-items: center;
}

.auth-home-logo {
    height: 42px;
    width: auto;
}

.auth-shell {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(470px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem;
    box-shadow: 0 18px 40px rgba(17, 27, 50, 0.12);
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    font-family: "Instrument Serif", "DM Sans", serif;
    font-weight: 400;
}

.auth-card p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.93rem;
}

.auth-form {
    margin-top: 1rem;
    display: grid;
    gap: 0.58rem;
}

.auth-form label {
    display: grid;
    gap: 0.22rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.auth-form input {
    border: 1px solid var(--line);
    border-radius: 9px;
    min-height: 2.35rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.95rem;
}

.auth-form button {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    border-radius: 9px;
    min-height: 2.35rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.auth-form button:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.auth-errors {
    margin: 0;
    padding: 0.55rem;
    list-style: none;
    border: 1px solid rgba(180, 35, 24, 0.3);
    color: var(--danger);
    background: rgba(180, 35, 24, 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
}

.auth-links {
    margin-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.auth-links a {
    color: var(--brand);
    text-decoration: none;
    font-size: 0.86rem;
}

.auth-links a:hover {
    text-decoration: underline;
}

.denied-card {
    text-align: center;
}

.denied-card h1 {
    margin-bottom: 0.25rem;
}

.denied-card .actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.denied-card .actions a {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    border-radius: 8px;
    padding: 0.45rem 0.72rem;
    font-size: 0.86rem;
}

.denied-card .actions a.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.auth-brand img {
    max-height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
