/* ============================================================
   Maple Lotto (G160) — styles
   Layout/feel adapted from Stoloto/Ruslotto, Canadian palette.
   Breakpoints tuned for 375px (mobile) and 1440px (desktop).
   ============================================================ */

:root {
    --red:        #d52b1e;   /* Canadian red */
    --red-dark:   #a81d13;
    --gold:       #f5b301;
    --gold-dark:  #d99a00;
    --ink:        #1c2230;
    --muted:      #5c6577;
    --bg:         #f4f6fb;
    --surface:    #ffffff;
    --line:       #e3e7ef;
    --green:      #1f9d57;
    --radius:     14px;
    --shadow:     0 6px 24px rgba(28, 34, 48, .08);
    --shadow-lg:  0 14px 40px rgba(28, 34, 48, .14);
    --max:        1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

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

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
    position: absolute; left: -999px; top: 0;
    background: var(--ink); color: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .5em; padding: .8em 1.5em; border-radius: 999px; font-weight: 700;
    border: 2px solid transparent; cursor: pointer; font-size: 1rem;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: var(--shadow); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,.05); text-decoration: none; }
.btn-lg { padding: 1em 2em; font-size: 1.15rem; }
.btn-block { width: 100%; }

/* ---- Header ---- */
.site-header {
    background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: 1.25rem; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.5rem; }
.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.primary-nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { color: var(--ink); font-weight: 600; }
.primary-nav a:hover { color: var(--red); text-decoration: none; }
.nav-auth { display: flex; gap: 10px; }
.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: 0;
    cursor: pointer; padding: 8px; margin-left: auto;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--ink); border-radius: 2px; }

/* ---- Flash ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-weight: 600; }
.flash-success { background: #e7f6ee; color: var(--green); }
.flash-error { background: #fdeceb; color: var(--red-dark); }
.flash-info { background: #eef2fd; color: #2647b0; }

/* ---- Hero ---- */
.hero {
    background: radial-gradient(circle at 20% 20%, #ff5142, var(--red) 55%, var(--red-dark));
    color: #fff; padding: 64px 0; overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.2rem; opacity: .95; margin-bottom: 1.5em; }
.jackpot-card {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius); padding: 28px; backdrop-filter: blur(4px); text-align: center;
}
.jackpot-label { text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; opacity: .9; }
.jackpot-amount { font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 900; color: var(--gold); margin: 6px 0; }
.jackpot-meta { opacity: .9; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---- Sections ---- */
.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head p { color: var(--muted); }
.section-alt { background: var(--surface); }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 2rem; font-weight: 900; color: var(--red); }
.stat-label { color: var(--muted); }

/* ---- Cards grid ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card {
    background: var(--surface); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .15s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card img { width: 100%; height: 170px; object-fit: cover; background: #e9edf6; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: .35em; }
.card-jackpot { color: var(--red); font-weight: 800; font-size: 1.3rem; }
.card-desc { color: var(--muted); flex: 1; margin: .5em 0 1em; }
.card-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1em; }

/* ---- Draw results balls ---- */
.balls { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.ball {
    width: 40px; height: 40px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 800;
    background: var(--gold); color: var(--ink); box-shadow: var(--shadow);
}
.result-row {
    background: var(--surface); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); margin-bottom: 16px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.result-row h3 { margin: 0; }
.result-date { color: var(--muted); font-size: .9rem; }

/* ---- Winners ---- */
.winner-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.winner-card img { width: 100%; height: 200px; object-fit: cover; }
.winner-body { padding: 20px; }
.winner-amount { color: var(--green); font-weight: 900; font-size: 1.5rem; }
.winner-meta { color: var(--muted); font-size: .9rem; margin-bottom: .5em; }

/* ---- Steps (how to play) ---- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: step; }
.step { background: var(--surface); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.step::before {
    counter-increment: step; content: counter(step);
    display: inline-flex; width: 44px; height: 44px; border-radius: 50%;
    background: var(--red); color: #fff; font-weight: 800; font-size: 1.3rem;
    align-items: center; justify-content: center; margin-bottom: 12px;
}

/* ---- Prose / legal pages ---- */
.prose { background: var(--surface); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); max-width: 860px; margin: 0 auto; }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.page-head { background: var(--ink); color: #fff; padding: 48px 0; }
.page-head h1 { color: #fff; margin: 0; }
.page-head p { color: rgba(255,255,255,.8); margin: .4em 0 0; }

/* ---- Forms ---- */
.form-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px; max-width: 480px; margin: 0 auto; }
.form-wide { max-width: 720px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: 10px; font-size: 1rem; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--red); border-color: var(--red); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; }
.checkbox input { width: auto; margin-top: 4px; }
.form-error { color: var(--red-dark); font-size: .9rem; margin-top: 4px; }
.form-foot { text-align: center; margin-top: 16px; color: var(--muted); }
.errors { background: #fdeceb; color: var(--red-dark); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; }
.errors ul { margin: 0; padding-left: 1.2em; }

/* ---- FAQ ---- */
.faq-item { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.faq-item summary { padding: 18px 22px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { color: var(--red); }
.faq-item .faq-answer { padding: 0 22px 20px; color: var(--muted); }

/* ---- Account ---- */
.account-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.account-side { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.account-side .avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; }
.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-list li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.detail-list li:last-child { border-bottom: 0; }
.detail-list .k { color: var(--muted); }
.detail-list .v { font-weight: 600; }

/* ---- Footer ---- */
.site-footer { background: #161b27; color: #c7cdda; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; padding: 48px 20px; }
.footer-col h3 { color: #fff; font-size: 1rem; margin-bottom: .8em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #c7cdda; }
.footer-col a:hover { color: #fff; }
.footer-brand p { color: #8b93a6; }
.footer-legal { border-top: 1px solid #2a3142; padding: 24px 0; font-size: .85rem; color: #8b93a6; }
.footer-legal a { color: #c7cdda; }
.footer-legal p { margin: .5em 0; }
.age-warning { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #c7cdda; }
.age-badge { background: var(--red); color: #fff; border-radius: 8px; padding: 2px 8px; font-weight: 800; }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt { margin-top: 24px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .account-grid { grid-template-columns: 1fr; }

    .nav-toggle { display: flex; }
    .primary-nav {
        position: fixed; inset: 64px 0 auto 0; background: var(--surface);
        flex-direction: column; align-items: stretch; gap: 0; margin: 0;
        padding: 12px 20px 24px; box-shadow: var(--shadow-lg);
        transform: translateY(-120%); transition: transform .25s ease;
        max-height: calc(100vh - 64px); overflow: auto;
    }
    .primary-nav.open { transform: translateY(0); }
    .primary-nav ul { flex-direction: column; gap: 0; }
    .primary-nav li { border-bottom: 1px solid var(--line); }
    .primary-nav a { display: block; padding: 14px 0; }
    .nav-auth { padding-top: 14px; }
}

@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .prose { padding: 24px; }
    .form-card { padding: 24px; }
    .result-row { flex-direction: column; align-items: flex-start; }
}
