:root {
    --navy: #073f70;
    --navy-dark: #06345d;
    --red: #ca0712;
    --yellow: #ffd31c;
    --green: #128252;
    --ink: #191f26;
    --muted: #68717c;
    --line: #e5e9ed;
    --surface: #ffffff;
    --background: #f7f8fa;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: var(--background);
    font-size: 16px;
    line-height: 1.55;
}

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 65% 35%, rgba(255, 255, 255, 0.1), transparent 24%),
        linear-gradient(112deg, #063d70 0%, #074b85 49%, #ca0712 100%);
    border-bottom: 5px solid var(--yellow);
}

.flag-line {
    display: flex;
    height: 5px;
    width: min(50%, 520px);
    margin: 0 auto;
}

.flag-line span:nth-child(1) {
    flex: 1;
    background: var(--yellow);
}

.flag-line span:nth-child(2) {
    flex: 1;
    background: var(--navy);
}

.flag-line span:nth-child(3) {
    flex: 1;
    background: var(--red);
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 43px 24px 37px;
    text-align: center;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.85rem, 4vw, 2.55rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hero p {
    margin: 5px 0 0;
    font-size: 1.22rem;
    font-weight: 600;
}

.hero .kicker {
    margin-bottom: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    opacity: 0.82;
    text-transform: uppercase;
}

.page-shell {
    width: min(100% - 32px, 620px);
    margin: 55px auto 52px;
    flex: 1;
}

.search-card,
.results-card {
    border: 1px solid #edf0f2;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 5px 20px rgba(14, 31, 53, 0.11);
}

.search-card {
    padding: 48px 60px;
}

.search-card > p {
    margin: 0 0 25px;
    color: #555e68;
}

.search-form {
    display: grid;
}

.search-form label {
    margin-bottom: 7px;
    font-weight: 700;
}

.search-form input {
    width: 100%;
    min-height: 52px;
    padding: 11px 15px;
    border: 1px solid #cfd5db;
    border-radius: 5px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 1.1rem;
}

.search-form input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(7, 63, 112, 0.14);
}

.search-form small {
    margin-top: 5px;
    color: var(--muted);
}

.search-form button,
.download-button {
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.search-form button {
    min-height: 54px;
    margin-top: 24px;
    background: var(--navy);
    box-shadow: 0 4px 10px rgba(7, 63, 112, 0.28);
    cursor: pointer;
    font-size: 1.05rem;
}

.search-form button:hover,
.search-form button:focus-visible {
    background: var(--navy-dark);
    transform: translateY(-1px);
}

.results-card {
    overflow: hidden;
}

.results-heading {
    padding: 9px 18px;
    background: var(--green);
    color: #fff;
    font-size: 0.9rem;
}

.results-note {
    margin: 15px 18px 5px;
    color: var(--muted);
    font-size: 0.82rem;
}

.result-list {
    padding: 0 18px 8px;
}

.result-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 13px 2px;
    border-bottom: 1px solid var(--line);
}

.result-item:last-child {
    border-bottom: 0;
}

.participant h3 {
    margin: 0 0 4px;
    font-size: 0.88rem;
    line-height: 1.35;
    text-transform: uppercase;
}

.participant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    color: var(--muted);
    font-size: 0.72rem;
}

.category {
    border-radius: 3px;
    padding: 1px 6px;
    background: var(--yellow);
    color: #4a3a00;
    font-weight: 700;
}

.download-button {
    min-width: 175px;
    padding: 10px 12px;
    background: var(--red);
    box-shadow: 0 3px 8px rgba(202, 7, 18, 0.23);
    text-align: center;
    font-size: 0.78rem;
}

.download-button:hover,
.download-button:focus-visible {
    background: #a90009;
    transform: translateY(-1px);
}

.empty-state {
    padding: 25px;
    border-left: 4px solid var(--yellow);
}

.empty-state p {
    margin: 5px 0 0;
    color: var(--muted);
}

.search-again {
    display: flex;
    min-height: 44px;
    margin: 12px 18px 18px;
    padding: 10px 18px;
    gap: 8px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--navy);
    border-radius: 6px;
    background: #fff;
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.search-again:hover,
.search-again:focus-visible {
    background: var(--navy);
    color: #fff;
    transform: translateY(-1px);
}

.privacy-note {
    margin-top: 28px;
    padding: 17px 18px;
    border-left: 4px solid var(--yellow);
    background: #fff;
    box-shadow: 0 2px 10px rgba(14, 31, 53, 0.04);
    font-size: 0.88rem;
}

.page-shell-wide {
    width: min(100% - 32px, 980px);
}

.field-gap {
    margin-top: 18px;
}

.admin-alert {
    margin-bottom: 20px;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid #edf0f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(14, 31, 53, 0.06);
}

.admin-meta {
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

.admin-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-link {
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
}

.admin-link:hover,
.admin-link:focus-visible {
    text-decoration: underline;
}

.admin-logout {
    margin: 0;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.82rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 18px 16px;
    border: 1px solid #edf0f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(14, 31, 53, 0.06);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: var(--navy);
    font-size: 1.8rem;
    line-height: 1.1;
}

.admin-table-card {
    margin-bottom: 22px;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

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

.badge-count {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f6ef;
    color: var(--green);
    font-weight: 700;
    text-align: center;
}

footer {
    padding: 30px 16px;
    background: var(--navy);
    color: #fff;
    text-align: center;
}

footer p {
    margin: 0;
}

footer small {
    opacity: 0.88;
}

.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;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .hero-content {
        padding: 34px 18px 30px;
    }

    .hero p {
        font-size: 1rem;
    }

    .page-shell,
    .page-shell-wide {
        width: min(100% - 22px, 980px);
        margin-top: 28px;
    }

    .search-card {
        padding: 30px 22px;
    }

    .result-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .download-button {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
