:root {
    --ink: #14212b;
    --paper: #f4f7f8;
    --card: #ffffff;
    --line: #d8e0e3;
    --blue-900: #0f2e3d;
    --blue-700: #14607e;
    --blue-500: #1c86ad;
    --teal: #2fb3a3;
    --muted: #5b6b72;
    --red: #c0392b;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 46, 61, 0.06), 0 6px 20px rgba(15, 46, 61, 0.06);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    background-image: radial-gradient(circle at 100% 0%, rgba(28, 134, 173, 0.10), transparent 40%);
    background-attachment: fixed;
}

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

#site {
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- header ---------- */

#site-header {
    padding: 1.1em 1.25em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1em;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    color: var(--ink) !important;
    text-decoration: none !important;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4em;
    height: 2.4em;
    border-radius: 50%;
    background: linear-gradient(155deg, var(--teal), var(--blue-900));
    color: #eafaf6;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.95em;
    box-shadow: var(--shadow);
}

.brand-name {
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

#top-nav {
    display: flex;
    align-items: center;
    gap: 1.2em;
    font-weight: 600;
    font-size: 0.95em;
}

#top-nav a {
    color: var(--muted);
}

#top-nav a:hover,
#top-nav a.active {
    color: var(--blue-700);
    text-decoration: none;
}

.logout-form {
    margin: 0;
    display: inline;
}

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
}

.link-button:hover {
    color: var(--blue-700);
    background: none;
    text-decoration: underline;
}

/* ---------- content ---------- */

#site-content {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.6em 1.8em 1.9em;
    margin: 0 1.25em 2em;
}

.content-heading h1 {
    margin: 0 0 0.7em;
    font-size: 1.6em;
    color: var(--blue-900);
    letter-spacing: -0.01em;
    border-bottom: 2px solid var(--teal);
    padding-bottom: 0.5em;
}

.content-body p, .content-body li {
    line-height: 1.55;
}

.lede {
    font-size: 1.1em;
    color: var(--blue-900);
}

/* ---------- footer ---------- */

#site-footer {
    text-align: center;
    padding: 1.5em;
    color: var(--muted);
    font-size: 0.85em;
}

/* ---------- cards ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1em;
    margin: 1.2em 0;
}

.feature-card {
    display: block;
    padding: 1.1em 1.2em;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #f7fbfb);
    color: var(--ink);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.feature-card h2 {
    margin: 0 0 0.3em;
    font-size: 1.05em;
    color: var(--blue-900);
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92em;
    line-height: 1.4;
}

/* ---------- tables ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

th, td {
    padding: 0.5em 0.7em;
    border-bottom: 1px solid var(--line);
}

thead th {
    background: var(--blue-900);
    color: #eafaf6;
    font-weight: 600;
    text-align: left;
}

/* ---------- forms ---------- */

form p {
    margin: 0 0 0.9em;
    display: flex;
    align-items: center;
    gap: 0.8em;
}

form p > label {
    min-width: 8.5em;
    font-weight: 600;
    font-size: 0.92em;
    color: var(--blue-900);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    font: inherit;
    padding: 0.45em 0.6em;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    min-width: 0;
    flex: 1 1 auto;
    max-width: 24em;
}

input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(28, 134, 173, 0.15);
}

button {
    font: inherit;
    font-weight: 600;
    padding: 0.55em 1.1em;
    border: none;
    border-radius: 7px;
    background: var(--blue-700);
    color: #fff;
    cursor: pointer;
    transition: background 0.12s ease;
}

button:hover {
    background: var(--blue-900);
}

/* ---------- misc ---------- */

code, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
    background: #eef4f5;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--blue-900);
    color: #eafaf6;
    padding: 1.1em 1.3em;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.85em;
    line-height: 1.5;
}
pre code {
    background: none;
    padding: 0;
}

.warn {
    background: #fdf3e0;
    border: 1px solid #d4a72c;
    color: #6b4c00;
    padding: 0.8em 1em;
    border-radius: var(--radius);
    margin-bottom: 1em;
}

.muted {
    color: var(--muted);
    font-size: 0.9em;
}

.messages {
    margin-bottom: 1em;
}

.msg {
    padding: 0.7em 1em;
    border-radius: var(--radius);
    margin-bottom: 0.5em;
    font-size: 0.92em;
}
.msg-info, .msg-debug {
    background: #e5f2f5;
    border: 1px solid var(--blue-500);
    color: var(--blue-900);
}
.msg-success {
    background: rgba(47, 179, 163, 0.15);
    border: 1px solid var(--teal);
    color: var(--blue-900);
}
.msg-warning {
    background: #fdf3e0;
    border: 1px solid #d4a72c;
    color: #6b4c00;
}
.msg-error {
    background: #fbe2de;
    border: 1px solid var(--red);
    color: var(--red);
}
