/* ==========================================================================
   Event Pic Share — main stylesheet
   Dark theme. Desktop-first; breakpoints at 920px and 600px.
   Uses modern CSS: nesting, oklch(), color-mix(), clamp().
   ========================================================================== */

:root {
    color-scheme: dark;

    --bg:        oklch(17% 0.02 275);
    --surface:   oklch(21% 0.02 275);
    --surface-2: oklch(25% 0.025 275);
    --line:      oklch(32% 0.02 275);
    --text:      oklch(93% 0.01 275);
    --muted:     oklch(72% 0.02 275);
    --accent:    oklch(74% 0.14 295);
    --accent-2:  oklch(62% 0.19 295);

    --radius: 14px;
    --wrap: 1100px;
    --shadow: 0 20px 50px oklch(10% 0.02 275 / 0.5);
}

/* --- Base ---------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(60rem 40rem at 85% -10%, oklch(30% 0.09 295 / 0.35), transparent 60%),
        radial-gradient(50rem 35rem at -10% 40%, oklch(28% 0.07 250 / 0.25), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-2);
    color: #fff;
}

h1, h2, h3 {
    line-height: 1.15;
    margin: 0 0 0.5em;
    text-wrap: balance;
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--accent);
}

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

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

.wrap {
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.wrap-narrow {
    max-width: 46rem;
}

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

.btn {
    display: inline-block;
    padding: 0.55rem 1.15rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease;

    &.btn-lg {
        padding: 0.85rem 1.7rem;
        font-size: 1.05rem;
    }
}

.btn-solid {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: oklch(15% 0.03 295);

    &:hover {
        background: var(--accent);
    }
}

.btn-outline {
    border: 1px solid var(--line);
    color: var(--text);

    &:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in oklch, var(--bg) 80%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: 0.8rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    font-size: 1.35rem;
}

.brand-accent {
    color: var(--accent);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;

    &:hover {
        color: var(--text);
    }
}

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

.hero {
    padding-block: 6rem 5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 3rem;
    align-items: center;
}

.eyebrow {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 36rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.75rem;
}

.hero-points {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin: 2rem 0 0;
    padding: 0;
    color: var(--muted);
    font-size: 0.95rem;

    & li::before {
        content: "✓";
        color: var(--accent);
        font-weight: 700;
        margin-right: 0.45rem;
    }
}

/* Fake event card with QR code */

.event-card {
    justify-self: center;
    margin: 0;
    width: min(320px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.6rem;
    text-align: center;
    rotate: 2deg;
}

.event-card-head {
    display: grid;
    gap: 0.15rem;
    margin-bottom: 1.1rem;

    & strong {
        font-size: 1.1rem;
    }

    & small {
        color: var(--muted);
    }
}

.qr-box {
    width: 190px;
    margin-inline: auto;
    padding: 0.9rem;
    background: #fff;
    border-radius: 10px;
    color: oklch(20% 0.02 275);
}

.event-card figcaption {
    margin-top: 1.1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

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

.section {
    padding-block: 4.5rem;
}

.section-head {
    text-align: center;
    margin-bottom: 2.75rem;

    & h2 {
        font-size: clamp(1.7rem, 3vw, 2.3rem);
        letter-spacing: -0.01em;
    }

    & p {
        color: var(--muted);
        margin: 0;
    }
}

/* --- How it works -------------------------------------------------------- */

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

    & li {
        counter-increment: step;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 1.9rem;

        &::before {
            content: counter(step, decimal-leading-zero);
            display: block;
            font-size: 2rem;
            font-weight: 800;
            letter-spacing: -0.03em;
            color: var(--accent);
            margin-bottom: 0.6rem;
        }

        & h3 {
            font-size: 1.15rem;
        }

        & p {
            margin: 0;
            color: var(--muted);
        }
    }
}

/* --- Features ------------------------------------------------------------ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.feature {
    background: color-mix(in oklch, var(--surface) 60%, transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;

    &:hover {
        border-color: color-mix(in oklch, var(--accent) 55%, var(--line));
        background: var(--surface);
    }

    & .feature-icon {
        font-size: 1.7rem;
    }

    & h3 {
        margin-top: 0.8rem;
        font-size: 1.05rem;
    }

    & p {
        margin: 0;
        color: var(--muted);
        font-size: 0.95rem;
    }
}

/* --- FAQ ------------------------------------------------------------------ */

.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 0.9rem;

    & summary {
        cursor: pointer;
        list-style: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1.1rem 1.4rem;
        font-weight: 600;

        &::-webkit-details-marker {
            display: none;
        }

        &::after {
            content: "+";
            font-size: 1.4rem;
            font-weight: 400;
            color: var(--accent);
            transition: rotate 0.2s ease;
        }
    }

    &[open] summary::after {
        rotate: 45deg;
    }

    & p {
        margin: 0;
        padding: 0 1.4rem 1.2rem;
        color: var(--muted);
    }
}

/* --- CTA panel ------------------------------------------------------------ */

.cta-panel {
    text-align: center;
    padding: 3.5rem 2rem;
    border-radius: calc(var(--radius) + 6px);
    border: 1px solid color-mix(in oklch, var(--accent) 40%, var(--line));
    background:
        radial-gradient(40rem 20rem at 50% -40%, oklch(40% 0.12 295 / 0.4), transparent 70%),
        var(--surface);

    & h2 {
        font-size: clamp(1.6rem, 3vw, 2.2rem);
    }

    & p {
        color: var(--muted);
        margin-bottom: 1.75rem;
    }
}

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

.site-footer {
    border-top: 1px solid var(--line);
    padding-block: 2rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;

    & p {
        margin: 0;
    }
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;

    & a {
        color: var(--muted);
        text-decoration: none;

        &:hover {
            color: var(--text);
        }
    }
}

/* --- Auth pages ----------------------------------------------------------- */

.auth-shell {
    display: flex;
    justify-content: center;
    padding-block: 4rem;
    padding-inline: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 27rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow);
    padding: 2.25rem;
}

.auth-head {
    margin-bottom: 1.75rem;

    & h1 {
        font-size: 1.6rem;
        letter-spacing: -0.01em;
    }

    & p {
        color: var(--muted);
        margin: 0;
        font-size: 0.95rem;
    }
}

.auth-alt {
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.auth-note {
    margin: 1.25rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

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

.field {
    margin-bottom: 1.1rem;

    & label {
        display: block;
        margin-bottom: 0.4rem;
        font-weight: 600;
        font-size: 0.9rem;
    }
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;

    & label {
        margin-bottom: 0.4rem;
    }
}

.field-link {
    font-size: 0.85rem;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

.optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;

    &:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 25%, transparent);
    }

    &::placeholder {
        color: color-mix(in oklch, var(--muted) 70%, transparent);
    }
}

.hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
    font-size: 0.92rem;
    color: var(--muted);
    cursor: pointer;

    & input[type="checkbox"] {
        width: 1.05rem;
        height: 1.05rem;
        accent-color: var(--accent-2);
        cursor: pointer;
    }
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button.btn {
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: 0;

    &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

.logout-form {
    display: inline;
}

/* --- Google button and divider -------------------------------------------- */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: #fff;
    color: #1f1f1f;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;

    &:hover {
        background: #ececec;
    }
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-block: 1.4rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    &::before,
    &::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--line);
    }
}

/* --- Alerts --------------------------------------------------------------- */

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;

    & ul {
        margin: 0;
        padding-left: 1.1rem;
    }

    & li + li {
        margin-top: 0.35rem;
    }
}

.alert-error {
    border-color: oklch(55% 0.16 25);
    background: oklch(30% 0.08 25 / 0.35);
    color: oklch(88% 0.06 25);
}

.alert-success {
    border-color: oklch(58% 0.13 155);
    background: oklch(30% 0.07 155 / 0.3);
    color: oklch(89% 0.06 155);
}

.alert-info {
    border-color: color-mix(in oklch, var(--accent) 60%, var(--line));
    background: color-mix(in oklch, var(--accent) 14%, transparent);
    color: oklch(90% 0.04 295);
}

/* --- Dashboard ------------------------------------------------------------ */

.nav-user {
    color: var(--muted);
    font-size: 0.9rem;
}

.dash-head {
    margin-bottom: 2rem;

    & h1 {
        font-size: clamp(1.7rem, 3vw, 2.2rem);
    }

    & p {
        color: var(--muted);
        margin: 0;
    }
}

.dash-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem;

    & > h2 {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);

    & .empty-icon {
        font-size: 2rem;
    }

    & p {
        color: var(--muted);
        max-width: 24rem;
        margin-inline: auto;
        margin-block: 0.75rem 1.25rem;
    }
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem 1.25rem;
    margin: 0;
    font-size: 0.93rem;

    & dt {
        color: var(--muted);
    }

    & dd {
        margin: 0;
    }
}

.pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.pill-ok {
    border-color: oklch(58% 0.13 155);
    color: oklch(85% 0.09 155);
    background: oklch(30% 0.07 155 / 0.3);
}

/* --- Breakpoints (desktop-first) ------------------------------------------ */

@media (max-width: 920px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-block: 3.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-copy .lead {
        margin-inline: auto;
    }

    .actions,
    .hero-points {
        justify-content: center;
    }

    .steps,
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .nav-link {
        display: none;
    }

    .section {
        padding-block: 3rem;
    }

    .steps,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .footer-bar {
        flex-direction: column;
        text-align: center;
    }
}

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

    * {
        transition: none !important;
    }
}
