:root {
    --ink: #12181f;
    --muted: #5b6472;
    --line: #e3e8ee;
    --accent: #0f7a5c;
    --accent-dark: #0a5c44;
    --accent-light: #e5f5ef;
    --bg: #f7f9f8;
    --card: #ffffff;
    --shadow-sm: 0 1px 2px rgba(16, 24, 32, 0.04), 0 1px 1px rgba(16, 24, 32, 0.03);
    --shadow-md: 0 8px 24px rgba(16, 24, 32, 0.08);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    letter-spacing: -0.01em;
    line-height: 1.2;
}

/* ---------- Header / nav ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

.brand-word {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ink);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    margin-left: auto;
}

.nav-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
}

.nav-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding-right: 0.15rem;
}

.site-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

.lead {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* ---------- Hero ---------- */

.hero {
    margin: 0 -1.5rem;
    padding: 3.5rem 1.5rem 3rem;
    background:
        radial-gradient(1200px 400px at 10% -10%, var(--accent-light), transparent),
        linear-gradient(180deg, #ffffff, var(--bg));
    border-bottom: 1px solid var(--line);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.hero-kicker {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-dark);
    background: var(--accent-light);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin: 0 0 1.1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 0.85rem;
    color: var(--ink);
}

.hero-subtitle {
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--muted);
    margin: 0 auto 1.75rem;
    max-width: 560px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.btn {
    display: inline-block;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    transform: translateY(-1px);
}

/* ---------- Stats strip ---------- */

.stats-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    margin: 0 -1.5rem;
    padding: 1.75rem 1.5rem;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.75rem;
    border-right: 1px solid var(--line);
    min-width: 110px;
}

.stat:last-child {
    border-right: none;
}

.stat-number {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--accent-dark);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

/* ---------- Groups section ---------- */

.groups-section {
    padding-top: 2.5rem;
}

.section-heading {
    max-width: 640px;
    margin-bottom: 1.75rem;
}

.section-heading h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.1rem;
}

.group-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--accent);
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.group-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.group-card h2,
.group-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: var(--accent-dark);
}

.subjects {
    font-weight: 600;
    margin: 0.25rem 0;
}

.official-code {
    display: inline-block;
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    margin: 0.1rem 0 0.4rem;
}

.summary {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.difficulty {
    font-size: 0.85rem;
    color: var(--muted);
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--accent);
    text-decoration: none;
}

section {
    margin-top: 1.75rem;
}

.pathway-list {
    padding-left: 1.2rem;
    line-height: 1.6;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: var(--muted);
    gap: 0.3rem;
}

.filter-field select {
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
}

.filter-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    height: fit-content;
}

.scholarship-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scholarship-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}

.scholarship-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.scholarship-head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--accent);
}

.scope-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.scope-state {
    background: #e6f4ef;
    color: #146c53;
}

.scope-national {
    background: #eef1fb;
    color: #35408e;
}

.scholarship-provider {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0.2rem 0 0.8rem;
}

.scholarship-details {
    display: grid;
    grid-template-columns: 130px 1fr;
    row-gap: 0.4rem;
    column-gap: 0.75rem;
    margin: 0 0 0.6rem;
}

.scholarship-details dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.scholarship-details dd {
    margin: 0;
    font-size: 0.9rem;
}

.future-note {
    font-size: 0.88rem;
    line-height: 1.5;
    background: var(--bg);
    border-left: 3px solid var(--accent);
    padding: 0.6rem 0.8rem;
    margin: 0 0 0.8rem;
    border-radius: 0 6px 6px 0;
}

.scholarship-notes {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
    margin: 0 0 0.8rem;
}

.relevant-groups {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 0.6rem;
}

.group-tag {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.scholarship-apply {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.next-steps {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--line);
}

.admin-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.admin-bar a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.admin-logout-form {
    margin-left: auto;
}

.admin-logout-btn {
    background: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--muted);
}

.admin-error {
    color: #b3261e;
    font-weight: 600;
    margin-bottom: 1rem;
}

.admin-login-form {
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-add-link {
    display: inline-block;
    text-decoration: none;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-row-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.admin-row-actions a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.admin-inline-form {
    display: inline;
}

.admin-delete-btn {
    background: none;
    border: none;
    color: #b3261e;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}

.admin-record-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 640px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.admin-field input,
.admin-field textarea {
    font: inherit;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    resize: vertical;
}

.quiz-question {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 0 0 1rem;
}

.quiz-question legend {
    font-weight: 600;
    padding: 0 0.3rem;
}

.quiz-option {
    display: block;
    padding: 0.35rem 0;
    cursor: pointer;
}

.quiz-option input {
    margin-right: 0.5rem;
}

.quiz-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.quiz-submit:hover {
    opacity: 0.9;
}

.result-card {
    margin-bottom: 1rem;
}

.result-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.dimension-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dimension-row {
    display: grid;
    grid-template-columns: 160px 1fr 2.5rem;
    align-items: center;
    gap: 0.6rem;
}

.dimension-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.dimension-track {
    background: var(--line);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.dimension-fill {
    background: var(--accent);
    height: 100%;
    border-radius: 999px;
}

.dimension-value {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: right;
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 2.5rem;
    padding: 1.5rem 0;
}

.site-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.footer-brand {
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--ink);
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 1.9rem;
    }
    .stats-strip {
        gap: 0.5rem;
    }
    .stat {
        padding: 0 0.9rem;
        min-width: 84px;
    }
}
