/* Nagradni žreb Integralis in Humanfrog
   Barve iz bannerja 2024 (navy -> teal) in Humanfrog zelena. */

:root {
    --navy: #0B2A5B;
    --ink: #0A1F44;
    --teal: #00C9A5;
    --teal-bright: #19E3BE;
    --teal-deep: #018F76;
    --paper: #F3F6FA;
    --white: #FFFFFF;
    --text: #14213D;
    --text-soft: #3B4A66;
    --muted: #64738E;
    --line: #D6DEE9;
    --line-strong: #B8C4D6;
    --danger: #B9303F;
    --danger-bg: #FCEEF0;
    --ok: #0E7F63;
    --ok-bg: #E6F7F1;

    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 24px 60px -28px rgba(11, 42, 91, 0.45), 0 2px 6px rgba(11, 42, 91, 0.06);
    --ring: 0 0 0 4px rgba(0, 201, 165, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--text);
    font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.55;
    font-weight: 500;
}

.page { flex: 1 0 auto; }

a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }

.wrap {
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    padding: 0 1rem;
}
.wrap-wide { max-width: 72rem; }

/* Naslovnica */

.hero {
    background:
        radial-gradient(60% 90% at 100% 0%, rgba(0, 201, 165, 0.55), transparent 70%),
        linear-gradient(120deg, var(--navy) 0%, var(--ink) 65%);
    color: var(--white);
    padding: 2.75rem 0 5.5rem;
}
.hero-kicker {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
}
.hero h1 {
    margin: 0;
    font-size: clamp(2.125rem, 7vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.04;
    max-width: 14ch;
}
.lead {
    margin: 1.25rem 0 0;
    font-size: 1.125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
    max-width: 34ch;
}
.hero-tall { padding: 4.5rem 0 4rem; flex: 1; }
.is-success { background: var(--ink); }
.is-success .page { display: flex; flex-direction: column; }
.is-success .hero h1 { max-width: 18ch; }
.mark { margin-bottom: 1.5rem; }
.mark svg { display: block; }

/* Kartica z obrazcem */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.25rem 1.75rem;
    margin: -3.75rem 0 2.5rem;
    position: relative;
}
@media (min-width: 600px) {
    .card { padding: 2.25rem 2.25rem 2.5rem; }
}

.field { margin-bottom: 1.125rem; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 480px) {
    .field-row { grid-template-columns: 1fr 1fr; }
}

label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}
.optional { font-weight: 500; color: var(--muted); }

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    height: 3rem;
    padding: 0 0.875rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-size: 1.0625rem;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
input::placeholder { color: #98A4B8; }
input:focus { outline: none; border-color: var(--teal-deep); box-shadow: var(--ring); }
input[aria-invalid="true"] { border-color: var(--danger); }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(185, 48, 63, 0.18); }

.error {
    margin: 0.375rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--danger);
}

.notice {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-weight: 600;
}
.notice-error { background: var(--danger-bg); color: var(--danger); }
.notice-ok { background: var(--ok-bg); color: var(--ok); }

/* Skrito polje proti botom */
.hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Soglasje */

.consent {
    margin: 1.5rem 0 1.5rem;
    padding: 1rem 1rem 0.25rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #FAFBFD;
}
.consent-error { border-color: var(--danger); }
.consent-label {
    display: grid;
    grid-template-columns: 1.375rem 1fr;
    gap: 0.75rem;
    align-items: start;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-soft);
    cursor: pointer;
}
.consent-label input {
    width: 1.375rem;
    height: 1.375rem;
    margin: 0.1rem 0 0;
    accent-color: var(--teal-deep);
    cursor: pointer;
}
.consent-label input:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.consent .error { margin-top: 0.75rem; }
.fineprint {
    margin: 0.875rem 0 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted);
}

/* Gumbi */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.25rem;
    padding: 0 1.5rem;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, transform 120ms ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--teal); color: var(--ink); }
.btn-primary:hover { background: var(--teal-bright); color: var(--ink); }

.btn-ghost {
    width: auto;
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); color: var(--white); }

.btn-ghost-dark {
    width: auto;
    background: transparent;
    color: var(--text-soft);
    border: 1.5px solid var(--line-strong);
    font-weight: 700;
}
.btn-ghost-dark:hover { border-color: var(--navy); color: var(--navy); }

/* Noga */

.footer {
    padding: 1.5rem 0 2rem;
    font-size: 0.875rem;
    color: var(--muted);
}
.footer p { margin: 0; }
.is-success .footer { background: var(--ink); color: rgba(255, 255, 255, 0.55); padding-top: 1.25rem; }

/* Admin */

.is-admin { font-size: 1rem; }
.admin-head {
    background: var(--navy);
    color: var(--white);
    padding: 1rem 0 1.75rem;
}
.admin-head h1 {
    margin: 1.25rem 0 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.admin-nav {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}
.admin-nav a {
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    text-decoration: none;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.admin-nav a[aria-current="page"] { background: var(--teal); color: var(--ink); }
.admin-nav-right { margin-left: auto; }

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin: 1.25rem 0 0;
}
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 0.875rem; color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    background: var(--white);
    color: var(--text);
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
}
.chip:hover { border-color: var(--navy); }
.chip[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip-count { font-weight: 600; opacity: 0.7; }

.table-wrap {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 0.75rem 0.875rem; text-align: left; vertical-align: top; }
.table thead th {
    position: sticky;
    top: 0;
    background: var(--white);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.8125rem;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--line); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: #F7F9FC; }
.table .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table tr.is-winner { background: #E3FBF5; font-weight: 700; }
.table tr.is-winner:hover { background: #D6F7EF; }
.table tr.is-reserve { background: #F2FBF8; }

.empty {
    margin: 0 0 2.5rem;
    color: var(--muted);
    text-align: center;
}
.empty p { margin: 0; }

.is-admin .card { margin-top: 1.5rem; }
.is-admin .notice { margin-top: 1.5rem; margin-bottom: 0; }
.draw-card { text-align: center; }
.lead-dark { margin: 0 auto 1.5rem; max-width: 40ch; color: var(--text-soft); }

.winners {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}
.winners li {
    display: grid;
    gap: 0.125rem;
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.winners li.is-winner {
    background: var(--ink);
    color: var(--white);
    padding: 1.75rem 1.5rem;
}
.winners li.is-winner a { color: var(--teal); }
.winners-place { font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.is-winner .winners-place { color: var(--teal); }
.winners-name { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; }
.is-winner .winners-name { font-size: 1.875rem; }
.winners-meta { color: var(--muted); }
.is-winner .winners-meta { color: rgba(255, 255, 255, 0.75); }
.hint { margin: 0.75rem 0 0; font-size: 0.9375rem; color: var(--muted); }

.help {
    margin: 0.375rem 0 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.manual-card { margin-bottom: 2.5rem; }
.manual-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.manual-row select {
    flex: 1 1 14rem;
    height: 3.25rem;
    padding: 0 0.875rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    font: inherit;
}
.manual-row select:focus { outline: none; border-color: var(--teal-deep); box-shadow: var(--ring); }
.manual-row select[aria-invalid="true"] { border-color: var(--danger); }
.manual-row .btn { flex: 0 0 auto; }

.howto {
    margin: 0 0 2.5rem;
    padding: 0 1.25rem;
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--text-soft);
    font-size: 0.9375rem;
}
.howto summary {
    padding: 1rem 0;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    list-style-position: inside;
}
.howto summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.howto ol { margin: 0; padding: 0 0 0.5rem 1.25rem; }
.howto li { margin-bottom: 0.625rem; line-height: 1.5; }
.howto li strong { color: var(--text); }
.howto .hint { padding-bottom: 1.125rem; margin-top: 0.5rem; }
.howto code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
