* { box-sizing: border-box; }
body {
    font-family: Lato, system-ui, sans-serif;
    margin: 0;
    color: #243038;
    background: #f4f7f8;
}
h1, h2, h3 { font-family: Righteous, sans-serif; font-weight: 400; }
a { color: #1d7eab; }
img { max-width: 100%; }

.topbar {
    display: flex;
    align-items: center;
    background: #309bcb;
    min-height: 76px;
}
.brand {
    background: #fda200;
    display: flex;
    align-items: center;
    padding: 10px 22px;
    align-self: stretch;
}
.brand a { display: flex; align-items: center; }
.brand img { height: 48px; width: auto; display: block; }
.user-meta {
    color: #fff;
    margin-left: 1.25rem;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    font-size: 0.95rem;
}
.user-meta span { opacity: 0.9; font-size: 0.85rem; }
.topbar nav {
    margin-left: auto;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: 0 1.5rem;
}
.topbar nav a {
    color: #fff;
    text-decoration: none;
    font-family: Righteous, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.95rem;
    white-space: nowrap;
}
.topbar nav a:hover { color: #ffe3b0; }
.topbar form.inline { display: inline; margin: 0; }

.container { max-width: 960px; margin: 0 auto; padding: 1.75rem 1.25rem 2.5rem; }
.container h1 { color: #e88900; margin-top: 0; }

.hero-banner {
    min-height: 560px;
    background: #071018 url("../images/banner.jpg") center 30% / cover no-repeat;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
    align-items: center;
    padding: 4.5rem 8vw;
    color: #fff;
}
.hero-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    color: #ffa500;
    margin: 0.2rem 0 0.8rem;
    line-height: 1.05;
}
.kicker {
    margin: 0;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #fcd59b;
}
.hero-copy p { font-size: 1.15rem; max-width: 36rem; line-height: 1.55; }
.hero-actions { margin-top: 1.4rem; }
.signin-card {
    background: rgba(255,255,255,0.95);
    color: #243038;
    border-radius: 10px;
    padding: 1.5rem 1.4rem 1.2rem;
    box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
.signin-card h2 { margin: 0 0 1rem; font-size: 1.45rem; color: #5d6870; text-align: center; }
.signin-card label { display: block; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.85rem; }
.signin-card input, .form input {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid #d5dde2;
    border-radius: 4px;
    font: inherit;
}
.signin-card button, .button, button {
    background: #309bcb;
    color: #fff;
    border: 0;
    padding: 0.7rem 1.1rem;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-family: Righteous, sans-serif;
    letter-spacing: 0.03em;
}
.signin-card button { width: 100%; margin-top: 0.3rem; }
.button.secondary { background: #257fa8; }
.card-note { text-align: center; margin: 0.9rem 0 0; }
.form-note { margin: 0.9rem 0 0; }

.band { background: #fff; padding: 4rem 1.25rem; }
.band-inner { max-width: 960px; margin: 0 auto; }
.band h2, .features h2 { text-align: center; color: #ffa500; font-size: 2rem; margin: 0 0 0.8rem; }
.band > .band-inner > p, .fine { text-align: center; font-size: 1.05rem; line-height: 1.6; }
.fine { color: #66727a; font-size: 0.9rem; }
.stat-row { display: flex; justify-content: center; gap: 1rem; margin: 1.5rem 0 0.5rem; }
.stat-row div {
    background: #f7f4ee;
    border-top: 4px solid #ffa500;
    min-width: 180px;
    padding: 1rem 1.25rem;
    text-align: center;
}
.stat-row span { display: block; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: #66727a; }
.stat-row strong { display: block; font-size: 1.8rem; color: #309bcb; margin-top: 0.2rem; }
.distribution { max-width: 720px; margin: 1.75rem auto 0; }
.distribution svg { width: 100%; height: auto; display: block; background: #f7f4ee; }
.distribution figcaption { text-align: center; color: #66727a; font-size: 0.9rem; margin-top: 0.6rem; }

.features { background: #eef3f5; padding: 4rem 1.25rem 4.5rem; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.feature-grid article { background: #fff; padding: 1.25rem 1.3rem; border-left: 4px solid #309bcb; }
.feature-grid h3 { margin: 0 0 0.4rem; color: #309bcb; font-size: 1.2rem; }
.feature-grid p { margin: 0; line-height: 1.5; }

.site-footer { background: #163544; color: #d5e4ea; text-align: center; padding: 1.2rem; }
.site-footer p { margin: 0.35rem 0; }
.site-footer a { color: #fcd59b; margin: 0 0.7rem; text-decoration: none; }
.site-footer a:hover { color: #fff; }

.prose { line-height: 1.6; }
.prose h1 { color: #e88900; }
.prose h2 { color: #309bcb; font-size: 1.45rem; margin-top: 1.8rem; }
.prose .formula {
    font-family: Righteous, sans-serif;
    font-size: 1.35rem;
    color: #e88900;
    text-align: center;
}
.prose ol, .prose ul { padding-left: 1.2rem; }
.contact-mail { font-size: 1.35rem; font-family: Righteous, sans-serif; }
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; }
.norm-grid td:nth-child(odd) { font-variant-numeric: tabular-nums; }

.flash-wrap { max-width: 960px; margin: 0 auto; padding: 1rem 1.25rem 0; }
.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.success { background: #e6f4ea; color: #137333; }
.flash.error { background: #fce8e6; color: #c5221f; }
.error-text { color: #c5221f; }
.form label { display: block; margin-bottom: 1rem; }
.form input { max-width: 360px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th, .data-table td { border: 1px solid #ddd; padding: 0.55rem 0.75rem; text-align: left; }
.data-table th { background: #309bcb; color: #fff; font-weight: 400; font-family: Righteous, sans-serif; }
.inline-form { margin-bottom: 1rem; }
.inline-form .button { display: inline-block; margin-right: 0.5rem; }
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.pack-grid article { background: #fff; border-top: 4px solid #fda200; padding: 1.1rem 1rem 1.3rem; text-align: center; }
.pack-grid h2 { margin: 0; color: #1c3a5f; font-size: 1.25rem; }
.pack-price { margin: 0.35rem 0 0.9rem; color: #309bcb; font-size: 1.8rem; font-family: Righteous, sans-serif; }
.topbar button {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.75);
    width: auto;
}
.topbar button:hover { background: rgba(255,255,255,0.16); }

.puzzle-matrix { display: grid; grid-template-columns: repeat(3, 110px); gap: 8px; justify-content: center; margin: 1rem auto; }
.puzzle-matrix img, .puzzle-blank { width: 110px; height: 110px; object-fit: contain; border: 1px solid #ccc; background: #fff; }
.puzzle-blank { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #888; }
.puzzle-choices { display: grid; grid-template-columns: repeat(4, 110px); gap: 8px; justify-content: center; margin-bottom: 1rem; }
.puzzle-choices label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.puzzle-choices img { width: 100px; height: 100px; object-fit: contain; border: 1px solid #ccc; background: #fff; }
.test-item { margin-bottom: 1.5rem; padding: 1rem; background: #fff; border: 1px solid #ddd; border-radius: 8px; }

@media (max-width: 800px) {
    .topbar { flex-wrap: wrap; }
    .brand { width: 100%; }
    .user-meta { margin: 0.6rem 1rem; }
    .topbar nav { width: 100%; padding: 0.6rem 1rem 0.9rem; }
    .hero-banner { grid-template-columns: 1fr; padding: 2.5rem 1.25rem; min-height: 0; }
    .feature-grid, .stat-row, .pack-grid { grid-template-columns: 1fr; flex-direction: column; }
}
