/* ==========================================================================
   UEE eVoting — student portal
   Palette is drawn from the UEE crest: royal navy on white, with a brighter blue accent.
   ========================================================================== */

:root {
    --ink: #06143d;
    --ink-2: #0a1f5c;
    --navy: #0b2a7a;
    --accent: #2f6bff;
    --accent-bright: #8db4ff;
    --accent-deep: #0b2a7a;
    --tint: #e7eefd;
    --paper: #f4f6fb;
    --white: #ffffff;
    --text: #0c1a40;
    --muted: #56617f;
    --line: #dde2ee;
    --line-dark: rgba(255, 255, 255, 0.12);
    --danger: #e5484d;

    --radius: 20px;
    --radius-sm: 12px;
    --shell: 1200px;
    --gutter: clamp(20px, 4vw, 40px);
    --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

    --font: 'Satoshi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin: 0;
}

:focus-visible {
    outline: 3px solid var(--accent-bright);
    outline-offset: 3px;
    border-radius: 6px;
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    background: var(--white);
    color: var(--ink);
    border-radius: 8px;
    font-weight: 700;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
}

/* ---------- Load bar ---------- */

.loadbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 300;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

.js .loadbar {
    animation: loadbar 1.1s var(--ease) forwards;
}

@keyframes loadbar {
    0% { transform: scaleX(0); opacity: 1; }
    70% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 0.25s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.25s;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex: none;
    transition: transform 0.25s var(--ease);
}

.btn:hover svg {
    transform: translateX(3px);
}

.btn:active {
    transform: scale(0.98);
}

.btn--primary {
    background: var(--white);
    color: var(--navy);
    box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.55);
}

.btn--primary:hover {
    background: var(--tint);
}

.btn--accent {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 12px 30px -14px rgba(47, 107, 255, 0.9);
}

.btn--accent:hover {
    background: #1f58e6;
}

.btn--ghost {
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--white);
}

.btn--ghost:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.btn--dark {
    background: var(--ink);
    color: var(--white);
}

.btn--dark:hover {
    background: var(--navy);
}

.btn--outline {
    border-color: var(--line);
    color: var(--text);
    background: var(--white);
}

.btn--outline:hover {
    border-color: var(--ink);
}

.btn--sm {
    min-height: 44px;
    padding: 0 20px;
    font-size: 0.94rem;
}

.btn--block {
    width: 100%;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.site-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand img {
    height: 60px;
    width: auto;
    flex: none;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.brand__name {
    font-weight: 900;
    font-size: 1.06rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.brand__sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav__link {
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.97rem;
    color: var(--muted);
    transition: color 0.2s, background-color 0.2s;
}

.nav__link:hover,
.nav__link[aria-current='page'] {
    color: var(--ink);
    background: var(--paper);
}

.nav .btn {
    margin-left: 10px;
}

.nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle span {
    position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav-toggle[aria-expanded='true'] span { background: transparent; }
.nav-toggle[aria-expanded='true'] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] span::after { transform: translateY(-6px) rotate(-45deg); }

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

.hero {
    position: relative;
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(900px 560px at 88% -10%, rgba(47, 107, 255, 0.42), transparent 62%),
        radial-gradient(700px 480px at -8% 110%, rgba(11, 42, 122, 0.9), transparent 60%),
        var(--ink);
}

/* Fine ballot-paper ruling, faded toward the edges */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-dark) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.35;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 20%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 20%, transparent 78%);
    pointer-events: none;
}

/* Crest watermark, knocked out to white and bled off the corner */
.hero__crest {
    position: absolute;
    right: -6%;
    bottom: -22%;
    width: min(62vw, 720px);
    height: auto;
    opacity: 0.06;
    filter: brightness(0) invert(1);
    pointer-events: none;
    user-select: none;
}

.hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    padding-block: clamp(56px, 8vw, 112px) clamp(64px, 8vw, 120px);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 12px;
    border: 1px solid var(--line-dark);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.86rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.86);
}

.eyebrow__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-bright);
    box-shadow: 0 0 0 4px rgba(141, 180, 255, 0.22);
}

.hero__title {
    margin-top: 26px;
    font-size: clamp(2.6rem, 6.4vw, 5rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.hero__title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.08em;
}

.hero__title .line > span {
    display: block;
}

.hero__title em {
    font-style: normal;
    color: var(--accent-bright);
}

.hero__lede {
    margin-top: 24px;
    max-width: 34em;
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.74);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

.hero__assurances {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin: 44px 0 0;
    padding: 28px 0 0;
    list-style: none;
    border-top: 1px solid var(--line-dark);
    font-size: 0.94rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.hero__assurances li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero__assurances svg {
    width: 18px;
    height: 18px;
    color: var(--accent-bright);
    flex: none;
}

/* ---------- Election notice card (hero) ---------- */

.notice {
    position: relative;
    background: var(--white);
    color: var(--text);
    border-radius: 28px;
    padding: clamp(24px, 3vw, 36px);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Ticket-stub perforation between header and body */
.notice__tear {
    position: relative;
    height: 1px;
    margin: 24px calc(clamp(24px, 3vw, 36px) * -1);
    border-top: 2px dashed var(--line);
}

.notice__tear::before,
.notice__tear::after {
    content: '';
    position: absolute;
    top: -13px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ink-2);
}

.notice__tear::before { left: -12px; }
.notice__tear::after { right: -12px; }

.notice__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notice__label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--tint);
    color: var(--accent-deep);
}

.pill--live {
    background: #fdecec;
    color: #b4232a;
}

.pill--live::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 1.6s ease-out infinite;
}

.pill--type {
    background: var(--tint);
    color: var(--navy);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.55); }
    100% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0); }
}

.notice__title {
    margin-top: 18px;
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-wrap: balance;
}

.notice__meta {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 500;
}

.countdown__label {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--muted);
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.countdown__cell {
    padding: 14px 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--paper);
    text-align: center;
}

.countdown__num {
    display: block;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.countdown__unit {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.notice__actions {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.notice__link {
    justify-self: center;
    padding: 8px 4px;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.notice__link:hover {
    border-color: currentColor;
}

.notice--empty .notice__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--tint);
    color: var(--accent-deep);
}

.notice--empty .notice__icon svg {
    width: 26px;
    height: 26px;
}

.notice__body {
    margin-top: 12px;
    color: var(--muted);
}

/* ---------- Sections ---------- */

.section {
    padding-block: clamp(64px, 9vw, 120px);
}

.section--white {
    background: var(--white);
}

.section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 48px;
    flex-wrap: wrap;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.kicker {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

.section__title {
    margin-top: 12px;
    font-size: clamp(2rem, 4.2vw, 3.2rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--ink);
    text-wrap: balance;
}

.section__intro {
    max-width: 30em;
    color: var(--muted);
}

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

.elections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 20px;
}

.election {
    display: flex;
    flex-direction: column;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.2s;
}

.election:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: 0 24px 48px -24px rgba(6, 20, 61, 0.28);
}

.election__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.election__title {
    margin-top: 22px;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.election__facts {
    display: grid;
    gap: 8px;
    margin: 16px 0 26px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.96rem;
    font-weight: 500;
}

.election__facts li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.election__facts svg {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--accent-deep);
}

.election__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.election__actions .btn {
    flex: 1 1 auto;
}

.empty {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: clamp(40px, 6vw, 72px) 24px;
    border: 1.5px dashed #c5cde0;
    border-radius: var(--radius);
    text-align: center;
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--tint);
    color: var(--accent-deep);
}

.empty__icon svg {
    width: 30px;
    height: 30px;
}

.empty h3 {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.empty p {
    max-width: 30em;
    color: var(--muted);
}

/* ---------- Steps ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 30px 28px 32px;
    border-radius: var(--radius);
    background: var(--paper);
    counter-increment: step;
}

.step::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--accent-deep);
}

.step__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 60px;
    margin-top: 22px;
    border-radius: 14px;
    background: var(--ink);
    color: var(--accent-bright);
}

.step__icon svg {
    width: 24px;
    height: 24px;
}

.step h3 {
    margin-top: 22px;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.step p {
    margin-top: 8px;
    color: var(--muted);
}

/* ---------- Before you vote ---------- */

.rules {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 88px);
    align-items: start;
}

.rules__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.rules__list li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.rules__list svg {
    width: 24px;
    height: 24px;
    margin-top: 2px;
    color: var(--accent);
}

.rules__list strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
}

.rules__list span {
    color: var(--muted);
}

/* ---------- CTA band ---------- */

.cta {
    position: relative;
    overflow: hidden;
    display: grid;
    align-items: end;
    min-height: clamp(380px, 46vw, 520px);
    padding: clamp(28px, 5vw, 64px);
    border-radius: 32px;
    color: var(--white);
    background-color: var(--ink);
    background-size: cover;
    background-position: 30% 60%;
    isolation: isolate;
}

.cta::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, rgba(6, 20, 61, 0.9) 0%, rgba(6, 20, 61, 0.55) 50%, rgba(6, 20, 61, 0.1) 100%);
}

.cta__title {
    max-width: 12em;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.02;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.cta__text {
    max-width: 30em;
    margin-top: 16px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
}

.cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

/* ---------- Footer ---------- */

.site-footer {
    padding-block: 40px 48px;
    border-top: 1px solid var(--line);
    background: var(--white);
    font-size: 0.94rem;
    color: var(--muted);
}

.site-footer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px 40px;
    flex-wrap: wrap;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 500;
}

.site-footer__links a {
    display: inline-block;
    padding: 6px 0;
}

.site-footer__links a:hover {
    color: var(--ink);
}

/* ---------- Load + scroll choreography ----------
   Everything is visible by default; motion only applies once the
   inline head script has confirmed JS is running (.js on <html>). */

.js [data-enter] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms + 120ms);
}

.js .hero__title .line > span {
    transform: translateY(105%);
    transition: transform 0.95s var(--ease);
    transition-delay: calc(var(--i, 0) * 110ms + 150ms);
}

.js .notice[data-enter] {
    transform: translateY(36px) scale(0.97);
    transition-duration: 1s;
}

.js.is-loaded [data-enter],
.js.is-loaded .hero__title .line > span {
    opacity: 1;
    transform: none;
}

.js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: calc(var(--i, 0) * 80ms);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js [data-enter],
    .js [data-reveal],
    .js .hero__title .line > span {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .loadbar,
    .pill--live::before {
        animation: none !important;
    }

    .btn,
    .btn svg,
    .election {
        transition: none;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .hero__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .notice {
        max-width: 520px;
    }

    .steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .rules {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        position: absolute;
        inset: 100% 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px var(--gutter) 20px;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 40px -24px rgba(6, 20, 61, 0.3);
    }

    .js .nav {
        display: none;
    }

    .js .nav.is-open {
        display: flex;
    }

    .nav__link {
        padding: 14px 16px;
        border-radius: 12px;
        font-size: 1.05rem;
    }

    .nav .btn {
        margin: 8px 0 0;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 16px;
    }

    .brand img {
        height: 44px;
    }

    .hero__actions .btn,
    .cta__actions .btn {
        width: 100%;
    }

    .cta {
        border-radius: 24px;
    }

    .countdown {
        gap: 6px;
    }
}

/* ==========================================================================
   Inner pages
   ========================================================================== */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

/* ---------- Page band (content pages + task pages) ---------- */

.band {
    position: relative;
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(700px 360px at 90% -30%, rgba(47, 107, 255, 0.4), transparent 62%),
        var(--ink);
}

.band::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-dark) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-dark) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.3;
    -webkit-mask-image: radial-gradient(ellipse 70% 100% at 70% 0%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 100% at 70% 0%, #000 10%, transparent 75%);
    pointer-events: none;
}

.band__inner {
    position: relative;
    padding-block: clamp(44px, 6vw, 80px);
}

.band--task .band__inner {
    padding-bottom: clamp(120px, 14vw, 160px);
    text-align: center;
}

.band__kicker {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-bright);
}

.band__title {
    margin-top: 12px;
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.band--task .band__title {
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    max-width: 22em;
    margin-inline: auto;
}

.band__lede {
    max-width: 38em;
    margin-top: 16px;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.76);
}

.band--task .band__lede {
    margin-inline: auto;
}

/* ---------- Task card (register, accredit, confirmations) ---------- */

.task {
    position: relative;
    padding-bottom: clamp(56px, 8vw, 96px);
}

.task__card {
    width: 100%;
    max-width: 520px;
    margin: calc(clamp(80px, 10vw, 112px) * -1) auto 0;
    padding: clamp(24px, 4vw, 40px);
    border-radius: 28px;
    background: var(--white);
    box-shadow: 0 40px 80px -40px rgba(6, 20, 61, 0.45), 0 0 0 1px var(--line);
}

.task__card--center {
    text-align: center;
}

.task__title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--ink);
    text-wrap: balance;
}

.task__text {
    margin-top: 10px;
    color: var(--muted);
}

.task__foot {
    margin-top: 22px;
    text-align: center;
    font-size: 0.96rem;
    color: var(--muted);
}

.link {
    color: var(--navy);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link:hover {
    color: var(--accent);
}

.task__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    border-radius: 22px;
    background: var(--tint);
    color: var(--navy);
}

.task__icon svg {
    width: 34px;
    height: 34px;
}

.task__icon--success {
    background: #e3f6ec;
    color: #0f7a4a;
}

.task__icon--closed {
    background: #fdecec;
    color: #b4232a;
}

/* Registration progress: three real, ordered stages */
.stages {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.stages li {
    flex: 1 1 0;
    padding-top: 10px;
    border-top: 3px solid var(--line);
    text-align: left;
}

.stages li.is-done {
    border-color: var(--accent-bright);
    color: var(--text);
}

.stages li.is-current {
    border-color: var(--accent);
    color: var(--navy);
}

/* ---------- Forms ---------- */

.field {
    display: grid;
    gap: 8px;
    margin-top: 20px;
}

.field label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
}

.field__hint {
    font-size: 0.88rem;
    color: var(--muted);
}

.input {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder {
    color: #9aa3ba;
}

.input:hover {
    border-color: #b9c2d8;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.18);
}

.input--code {
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.input--code::placeholder {
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
}

.form__submit {
    margin-top: 26px;
}

.field__error {
    font-size: 0.9rem;
    font-weight: 700;
    color: #b4232a;
}

/* ---------- Alerts (classes come from the controllers' session flashes) ---------- */

.alert {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 0.96rem;
    font-weight: 500;
    text-align: left;
}

.alert:first-child {
    margin-top: 0;
}

.alert-info {
    background: var(--tint);
    border-color: #c9d8fb;
    color: var(--navy);
}

.alert-danger {
    background: #fdecec;
    border-color: #f6c7c9;
    color: #9c1c22;
}

.alert-success {
    background: #e3f6ec;
    border-color: #b9e6cd;
    color: #0c6039;
}

/* ---------- Detail list (confirm your details) ---------- */

.details {
    margin: 22px 0 0;
    border-top: 1px solid var(--line);
}

.details > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.details dt {
    flex: none;
    font-size: 0.92rem;
    color: var(--muted);
}

.details dd {
    margin: 0;
    font-weight: 700;
    color: var(--ink);
    text-align: right;
    overflow-wrap: anywhere;
}

/* ---------- Content pages ---------- */

.content {
    padding-block: clamp(44px, 7vw, 88px);
}

.prose {
    max-width: 70ch;
    color: #2b3657;
}

.prose p {
    margin-top: 1em;
}

.prose p:first-child {
    margin-top: 0;
}

.prose strong {
    color: var(--ink);
}

.prose h2 {
    margin-top: 2em;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.prose a {
    color: var(--navy);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* How to vote: a real ordered procedure */
.guide {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}

.procedure {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: proc;
}

.procedure li {
    position: relative;
    padding: 0 0 30px 64px;
    counter-increment: proc;
}

.procedure li::before {
    content: counter(proc);
    position: absolute;
    left: 0;
    top: -4px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--white);
    font-weight: 900;
}

.procedure li::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 44px;
    bottom: 6px;
    width: 2px;
    background: var(--line);
}

.procedure li:last-child {
    padding-bottom: 0;
}

.procedure li:last-child::after {
    display: none;
}

.procedure h3 {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.procedure p {
    margin-top: 4px;
    color: var(--muted);
}

.aside-card {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--line);
}

.aside-card h2 {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.aside-card ul {
    display: grid;
    gap: 14px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.97rem;
}

.aside-card li {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
}

.aside-card svg {
    width: 20px;
    height: 20px;
    margin-top: 3px;
    color: var(--accent);
}

.aside-card .btn {
    margin-top: 24px;
}

/* Contact */
.contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 20px;
}

.contact {
    display: flex;
    flex-direction: column;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.2s;
}

a.contact:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: 0 24px 48px -24px rgba(6, 20, 61, 0.28);
}

.contact__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--ink);
    color: var(--accent-bright);
}

.contact__icon svg {
    width: 24px;
    height: 24px;
}

.contact__label {
    margin-top: 22px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.contact__value {
    margin-top: 6px;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.contact__note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.96rem;
}

/* ---------- Contestants ---------- */

.position-block + .position-block {
    margin-top: clamp(40px, 6vw, 64px);
}

.position-block__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.position-block__title {
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.position-block__count {
    flex: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
}

.position-block__empty {
    margin-top: 18px;
    color: var(--muted);
}

.people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
    gap: 18px;
    margin-top: 22px;
}

.person {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.person__photo {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: var(--tint);
}

.person__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 18px;
}

.person__name {
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.person__meta {
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--muted);
}

.person__link {
    align-self: flex-start;
    margin-top: 8px;
    padding: 4px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.person__action {
    margin-top: auto;
    padding-top: 16px;
}

.person.is-chosen {
    border-color: #0f7a4a;
    box-shadow: 0 0 0 2px #0f7a4a;
}

.voted-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border-radius: 999px;
    background: #e3f6ec;
    color: #0c6039;
    font-weight: 700;
    font-size: 0.94rem;
}

.voted-badge svg {
    width: 18px;
    height: 18px;
}

/* ---------- Ballot ---------- */

.ballot-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ink);
    color: var(--white);
}

.ballot-bar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
}

.ballot-bar__who {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ballot-bar__who img {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 50%;
    background: var(--white);
    flex: none;
}

.ballot-bar__name {
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ballot-bar__reg {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.66);
}

.ballot-bar__timer {
    flex: none;
    text-align: right;
}

.ballot-bar__timer span {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.66);
}

.ballot-bar__timer strong {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.ballot {
    padding-block: clamp(28px, 4vw, 48px) clamp(56px, 8vw, 96px);
}

.ballot__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
    margin-bottom: clamp(24px, 4vw, 40px);
}

.ballot__title {
    margin-top: 8px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: var(--ink);
}

.ballot__progress {
    font-weight: 700;
    color: var(--muted);
}

.ballot__layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}

.positions {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 10px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.positions__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    font-weight: 700;
    color: var(--muted);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.positions__btn:hover {
    background: var(--paper);
    color: var(--ink);
}

.positions__btn[aria-selected='true'] {
    background: var(--ink);
    color: var(--white);
}

.positions__tick {
    display: none;
    flex: none;
    width: 20px;
    height: 20px;
    color: #1fa565;
}

.positions__btn.is-voted .positions__tick {
    display: block;
}

.positions__btn[aria-selected='true'] .positions__tick {
    color: #6ee0a6;
}

.panel[hidden] {
    display: none;
}

.panel__title {
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.panel__hint {
    margin-top: 4px;
    color: var(--muted);
}

.ballot__nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: clamp(28px, 4vw, 44px);
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.ballot__nav [hidden] {
    display: none;
}

/* ---------- Dialog ---------- */

.dialog {
    width: min(92vw, 460px);
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: var(--white);
    color: var(--text);
    box-shadow: 0 40px 100px -30px rgba(6, 20, 61, 0.6);
}

.dialog::backdrop {
    background: rgba(6, 20, 61, 0.6);
    backdrop-filter: blur(3px);
}

.dialog__body {
    padding: 30px 30px 26px;
}

.dialog__title {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.dialog__text {
    margin-top: 10px;
    color: var(--muted);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.dialog__text strong {
    color: var(--ink);
}

.dialog__note {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #9c1c22;
}

.dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.dialog--wide {
    width: min(92vw, 640px);
}

.dialog--wide .dialog__text {
    max-height: 56vh;
    overflow-y: auto;
}

.btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.btn--success {
    background: #0f7a4a;
    color: var(--white);
}

.btn--success:hover {
    background: #0c6039;
}

/* ---------- Inner pages: responsive ---------- */

@media (max-width: 980px) {
    .guide {
        grid-template-columns: minmax(0, 1fr);
    }

    .ballot__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    /* positions become a horizontally scrolling strip */
    .positions {
        position: static;
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    .positions li {
        flex: none;
        scroll-snap-align: start;
    }

    .positions__btn {
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    .ballot-bar__timer strong {
        font-size: 1.15rem;
    }

    .people {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .person__body {
        padding: 12px 12px 14px;
    }

    .ballot__nav .btn {
        flex: 1;
        padding-inline: 14px;
    }

    .dialog__actions {
        flex-direction: column-reverse;
    }

    .dialog__actions .btn {
        width: 100%;
    }

    .details > div {
        flex-direction: column;
        gap: 2px;
    }

    .details dd {
        text-align: left;
    }
}
