@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: optional;
    src: url("../fonts/inter-latin-var.woff2") format("woff2");
}

:root {
    --ink: #1c1c1c;
    --muted: #5c5c5c;
    --line: #d8d8d8;
    --bad: #a4262c;
    --good: #0f7b34;
    --brand-gradient: linear-gradient(-135deg, #c850c0, #4158d0);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #fff;
}

header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.brand {
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    text-decoration: none;
    color: var(--ink);
}
.who { color: var(--muted); font-size: 0.9rem; }
.inline { display: inline; }

main { max-width: 60rem; margin: 0 auto; padding: 1.5rem; }
.narrow { max-width: 22rem; }

h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }

.hint { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--bad); }
.ok { color: var(--good); }

label { display: block; margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }

input[type="text"], input[type="password"], input:not([type]) {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
}

button {
    margin-top: 1.25rem;
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: 4px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

button.link {
    margin: 0;
    padding: 0;
    background: none;
    color: var(--muted);
    text-decoration: underline;
}

.upload {
    padding: 1.25rem;
    border: 1px dashed var(--line);
    border-radius: 6px;
}

.upload button { margin-top: 1rem; }

table.errors {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.errors th, table.errors td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

table.errors th { color: var(--muted); font-weight: 600; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.app-theme {
    min-height: 100vh;
    background: var(--brand-gradient);
}

body.app-theme header .bar {
    border-bottom: none;
}

body.app-theme .brand {
    color: rgba(255, 255, 255, 0.95);
}

body.app-theme .who {
    color: rgba(255, 255, 255, 0.85);
}

body.app-theme button.link {
    color: rgba(255, 255, 255, 0.85);
}

body.app-theme main {
    max-width: none;
    min-height: calc(100vh - 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.page-card {
    width: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 2.5rem 2rem 2rem;
}

.page-card--narrow { max-width: 22rem; }
.page-card--medium { max-width: 34rem; }
.page-card--wide { max-width: 54rem; }

.page-card h1 {
    margin-top: 0;
}

.page-card button[type="submit"] {
    width: 100%;
    margin-top: 1.75rem;
    border-radius: 25px;
    background: #57b846;
    font-weight: 600;
}

.page-card button[type="submit"]:hover {
    background: #333;
}

.login-card button[type="submit"] {
    height: 3rem;
}

.login-card .field {
    position: relative;
    margin-top: 1.1rem;
}

.login-card .field:first-of-type {
    margin-top: 0;
}

.login-card .field svg {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #888;
}

.login-card .field input[type="text"],
.login-card .field input[type="password"],
.login-card .field input:not([type]) {
    height: 3rem;
    padding: 0 1rem 0 2.75rem;
    border: none;
    border-radius: 25px;
    background: #e6e6e6;
}

.login-card .field input:focus {
    outline: 2px solid #57b846;
}

.page-card .error {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.spinner::after {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-left: 0.5em;
    border: 2px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -0.1em;
}

@keyframes spin { to { transform: rotate(360deg); } }
