:root {
    --bg: #001b44;
    --bg-mid: #003a8c;
    --bg-light: #1e6fd1;
    --surface: #0b1630;
    --surface-soft: #111d38;
    --text: #ffffff;
    --muted: #b8c3d9;
    --border: rgba(255, 255, 255, 0.28);
    --primary: #004b93;
    --accent: #005eb8;
    --success: #3dd68c;
    --error: #ff6b6b;
    --header-bg: linear-gradient(180deg, #000814 0%, #001b44 100%);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --nav-font: "Montserrat", sans-serif;
    /* Browser zoom-out: JS caps layout vw; fonts scale up to compensate */
    --effective-vw: 100vw;
    --zoom-font-scale: 1;
}

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

html {
    scroll-behavior: smooth;
    font-size: calc(100% * var(--zoom-font-scale));
}

body {
    margin: 0;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(900px 720px at 50% 35%, rgba(40, 120, 220, 0.55), transparent 70%),
        linear-gradient(180deg, #00102e 0%, #002f7a 45%, #1a6fd4 100%);
    line-height: 1.5;
    min-height: 100vh;
}

img {
    display: block;
    height: auto;
}

a {
    color: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-shell {
    /* Design: 1920px screen → content 1580px; scales proportionally with viewport */
    width: calc(var(--effective-vw) * 1580 / 1920);
    margin: 0 auto;
}

.narrow-shell {
    width: calc(var(--effective-vw) * 860 / 1920);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner,
.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
}

.hero-banner,
.duration-banner,
.stores-banner {
    width: 100%;
    margin: 0 auto;
}

.section-title-image {
    width: 100%;
    margin: 0 auto calc(var(--effective-vw) * 1.25 / 100);
}

.section-title-image--contact {
    /* Design: 1398px on a 1920px screen */
    width: calc(var(--effective-vw) * 1398 / 1920);
    margin-left: auto;
    margin-right: auto;
}

.prizes-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
}

.prizes-layout__weekly {
    flex: none;
    /* Design: 990px on a 1920px screen */
    width: calc(var(--effective-vw) * 990 / 1920);
    object-fit: contain;
}

.prizes-layout__daily {
    flex: none;
    /* Design: 590px on a 1920px screen */
    width: calc(var(--effective-vw) * 590 / 1920);
    object-fit: contain;
}

.steps-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    width: 100%;
}

.steps-grid img {
    /* Design: 466px within 1580px content shell — flush side by side */
    flex: 0 0 calc(100% * 466 / 1580);
    width: calc(100% * 466 / 1580);
    max-width: calc(100% * 466 / 1580);
    margin: 0;
    object-fit: contain;
}

.contact-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    width: 100%;
}

.contact-grid img {
    /* Design: 340px within 1580px content shell — flush side by side */
    flex: 0 0 calc(100% * 340 / 1580);
    width: calc(100% * 340 / 1580);
    max-width: calc(100% * 340 / 1580);
    margin: 0;
    object-fit: contain;
}

.site-header__logo,
.site-footer__logo {
    /* Design: 60px on a 1920px screen, never below 40px */
    width: max(40px, calc(var(--effective-vw) * 60 / 1920));
    height: auto;
    object-fit: contain;
}

.site-header__toggle {
    display: none;
    /* Match Pepsi logo size */
    width: max(40px, calc(var(--effective-vw) * 60 / 1920));
    height: max(40px, calc(var(--effective-vw) * 60 / 1920));
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.site-header__toggle-bar {
    display: block;
    width: 55%;
    height: 3px;
    margin: 5px auto;
    background: #fff;
}

.site-nav,
.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.35rem;
}

.site-nav a,
.site-footer__nav a {
    font-family: var(--nav-font);
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: 0.1px;
    text-transform: none;
    line-height: 1.3;
    text-decoration: none;
    color: #fff;
    padding: 0.2rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

.site-nav a:hover,
.site-footer__nav a:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.75);
}

.site-nav a.is-active {
    color: #8fd0ff;
    border-bottom-color: #8fd0ff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(143, 208, 255, 0.45);
}

.site-footer {
    margin-top: 2rem;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.back-to-top {
    position: fixed;
    /* Outside content shell, near viewport edge — clears footer privacy link */
    right: 1.5rem;
    bottom: 3.5rem;
    z-index: 50;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(0, 20, 60, 0.85);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background: rgba(0, 75, 147, 0.95);
    transform: translateY(-2px);
}

#top,
#nagrade,
#mehanizam,
#kontakt {
    scroll-margin-top: 0;
}

.hero-section,
.prizes-section,
.mechanism-section,
.duration-section,
.stores-section,
.contact-section,
.content-page {
    padding: 1.25rem 0;
}

.hero-section {
    padding-top: 1.75rem;
}

.duration-section,
.stores-section {
    padding-top: 0.5rem;
}

.contact-section {
    padding-bottom: 2.5rem;
}

.content-page {
    padding: 3rem 0 4rem;
}

.rules-page {
    padding-top: 0.5rem;
}

.rules-panel {
    background: rgba(255, 255, 255, 0.96);
    color: #142033;
    border-radius: 20px;
    padding: clamp(1.25rem, calc(var(--effective-vw) * 0.03), 2.5rem);
    box-shadow: var(--shadow);
    line-height: 1.65;
    font-size: clamp(0.92rem, calc(var(--effective-vw) * 0.0105), 1.05rem);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rules-lead {
    margin-top: 0;
}

.rules-title {
    margin: 1.5rem 0 1.25rem;
    font-size: clamp(1.15rem, calc(var(--effective-vw) * 0.022), 1.6rem);
    line-height: 1.25;
    text-align: center;
    color: #003a8c;
}

.rules-panel h2 {
    margin: 1.75rem 0 0.75rem;
    font-size: clamp(1.02rem, calc(var(--effective-vw) * 0.015), 1.2rem);
    line-height: 1.3;
    color: #004b93;
}

.rules-panel p,
.rules-panel li {
    margin: 0 0 0.85rem;
}

.rules-panel ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.rules-panel a {
    color: #005eb8;
    text-decoration: underline;
}

.rules-panel blockquote {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border-left: 4px solid #005eb8;
    background: rgba(0, 94, 184, 0.08);
    font-style: italic;
}

.rules-note {
    font-size: 0.92em;
    color: #3b4658;
}

.rules-signoff {
    margin-top: 2rem;
    font-weight: 700;
}

.rules-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0 1.25rem;
    border: 1px solid rgba(0, 59, 147, 0.2);
    border-radius: 14px;
}

.rules-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: #fff;
}

.rules-table caption {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    color: #003a8c;
    background: rgba(0, 94, 184, 0.08);
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    caption-side: top;
}

.rules-table th,
.rules-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(20, 32, 51, 0.12);
    text-align: left;
    vertical-align: top;
}

.rules-table thead th {
    background: #003a8c;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.rules-table tbody tr:nth-child(even) {
    background: rgba(0, 94, 184, 0.05);
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h1,
.section-heading h2 {
    margin: 0 0 0.75rem;
    line-height: 1.15;
    font-weight: 800;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.rich-panel,
.registration-form {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.rich-panel a {
    color: #8ec5ff;
}

.winners-live-table {
    min-width: 640px;
}

.winners-panel .winners-live-table th,
.winners-panel .winners-live-table td {
    color: #142033;
    border-bottom-color: rgba(20, 32, 51, 0.12);
}

.winners-panel .winners-live-table thead th {
    color: #fff;
}

.winners-panel.is-loading {
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.winners-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.35rem;
}

.winners-pagination__nav,
.winners-pagination__page {
    appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    line-height: 1;
}

.winners-pagination__nav {
    min-width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 58, 140, 0.1);
    color: #003a8c;
    font-size: 1.85rem;
    font-weight: 500;
    line-height: 1;
}

.winners-pagination__nav:hover:not(:disabled) {
    background: rgba(0, 58, 140, 0.18);
    transform: translateY(-1px);
}

.winners-pagination__nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.winners-pagination__page {
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: transparent;
    color: #003a8c;
    font-size: 1rem;
}

.winners-pagination__page:hover {
    background: rgba(0, 58, 140, 0.1);
}

.winners-pagination__page.is-active {
    background: #003a8c;
    color: #fff;
}

.winners-pagination__meta {
    margin: 0.75rem 0 0;
    text-align: center;
    color: #5a6b82;
    font-size: 0.92rem;
}

.registration-form {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-row--triple {
    grid-template-columns: 1.3fr 1.3fr 0.8fr;
}

.form-field {
    display: grid;
    gap: 0.4rem;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: #111;
    font: inherit;
}

.form-field input:focus {
    outline: 2px solid rgba(0, 94, 184, 0.35);
    border-color: var(--accent);
}

.form-consents {
    display: grid;
    gap: 0.75rem;
}

.consent-item {
    display: grid;
    gap: 0.3rem;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.consent-label input {
    margin-top: 0.2rem;
}

.consent-label a {
    color: #8ec5ff;
}

.field-error {
    min-height: 1.1rem;
    color: var(--error);
    font-size: 0.88rem;
}

.form-feedback {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    font-weight: 700;
}

.form-feedback--success {
    background: rgba(61, 214, 140, 0.15);
    color: var(--success);
}

.form-feedback--error {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error);
}

.submit-button {
    min-height: 3rem;
    padding: 0.85rem 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.submit-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.form-note {
    margin: 0;
    color: var(--muted);
}

/* Browser zoom ≤50%: same hamburger navbar as mobile */
html.is-zoom-nav-mobile .site-header__toggle {
    display: inline-block;
    margin-left: auto;
}

html.is-zoom-nav-mobile .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.5rem 0 0.85rem;
}

html.is-zoom-nav-mobile .site-nav.is-open {
    display: flex;
}

html.is-zoom-nav-mobile .site-header__inner {
    flex-wrap: wrap;
}

@media (max-width: 960px) {
    .site-header__toggle {
        display: inline-block;
        margin-left: auto;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        padding: 0.5rem 0 0.85rem;
    }

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

    .site-header__inner {
        flex-wrap: wrap;
    }

    .prizes-layout,
    .steps-grid,
    .contact-grid {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: calc(var(--effective-vw) * 24 / 1920);
    }

    .prizes-layout__weekly {
        flex-basis: auto;
        /* Mobile: same scale-up ratio as steps (720/466) */
        width: calc(var(--effective-vw) * 1530 / 1920);
        max-width: min(92%, calc(var(--effective-vw) * 1530 / 1920));
    }

    .prizes-layout__daily {
        flex-basis: auto;
        width: calc(var(--effective-vw) * 911 / 1920);
        max-width: min(92%, calc(var(--effective-vw) * 911 / 1920));
    }

    .steps-grid img {
        flex-basis: auto;
        /* Mobile: larger than desktop design ratio so steps stay readable when stacked */
        width: calc(var(--effective-vw) * 720 / 1920);
        max-width: min(92%, calc(var(--effective-vw) * 720 / 1920));
    }

    .contact-grid img {
        flex-basis: auto;
        /* Mobile: larger call-centar / radno-vreme / e-mail tiles */
        width: calc(var(--effective-vw) * 580 / 1920);
        max-width: min(92%, calc(var(--effective-vw) * 580 / 1920));
    }

    .site-footer__inner {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .site-footer__nav {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 720px) {
    .site-nav a,
    .site-footer__nav a {
        font-size: 0.875rem;
        letter-spacing: 0;
        line-height: 1.25;
    }

    .site-header__logo,
    .site-footer__logo {
        width: max(40px, calc(var(--effective-vw) * 60 / 1920));
    }

    .hero-section,
    .prizes-section,
    .mechanism-section,
    .duration-section,
    .stores-section,
    .contact-section,
    .content-page {
        padding: 0.85rem 0;
    }

    .hero-section {
        padding-top: 1rem;
    }

    .contact-section {
        padding-bottom: 2rem;
    }

    .form-row,
    .form-row--triple {
        grid-template-columns: 1fr;
    }

    .rules-table {
        min-width: 0;
        border: 0;
    }

    .rules-table thead {
        display: none;
    }

    .rules-table,
    .rules-table tbody,
    .rules-table tr,
    .rules-table td {
        display: block;
        width: 100%;
    }

    .rules-table tr {
        margin-bottom: 0.85rem;
        border: 1px solid rgba(0, 59, 147, 0.2);
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .rules-table td {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding: 0.7rem 0.85rem;
        border-bottom: 1px solid rgba(20, 32, 51, 0.08);
    }

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

    .rules-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #003a8c;
        font-size: 0.85em;
    }

    .rules-table caption {
        display: block;
        width: 100%;
        border-radius: 12px 12px 0 0;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    .rules-table-wrap {
        border: 0;
        overflow: visible;
    }
}
