/* DevOpsDays Passport — shares the Denver DevOps "mountain tech" look
   (see denverdevops.org/docs/styles.css). Same tokens, same card/button
   language, tuned for a phone-in-hand app instead of a marketing site. */

/* Space Grotesk is served from here rather than a CDN — same reason the QR
   libraries are: conference wifi is a liar, and the app must work offline-ish. */
@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("vendor/fonts/space-grotesk-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("vendor/fonts/space-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Space Grotesk", var(--font-sans);
    --color-ink: #1e2430;
    --color-navy: #16213e;
    --color-accent: #2563eb;
    --color-accent-dark: #1d4ed8;
    --color-accent-2: #10b981;
    --color-accent-2-dark: #059669;
    --color-amber: #d97706;
    --color-amber-dark: #b45309;
    --color-danger: #dc2626;
    --color-muted: #5b6472;
    --color-border: #e4e8ef;
    --color-surface-alt: #f7f9fc;
    --shadow-sm: 0 1px 3px rgba(22, 33, 62, 0.06), 0 1px 2px rgba(22, 33, 62, 0.04);
    --shadow-md: 0 8px 24px rgba(22, 33, 62, 0.08);
    --shadow-lg: 0 16px 40px rgba(22, 33, 62, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.65;
    color: var(--color-ink);
    background: linear-gradient(180deg, #f8fafc 0%, #eef1f6 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-navy);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

h2 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    margin-bottom: 0.35rem;
}

p {
    margin-bottom: 0.75rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.accent-word { color: var(--color-accent); }
.accent-word-alt { color: var(--color-accent-2); }

.eyebrow {
    display: inline-block;
    background: #eef2ff;
    color: var(--color-accent-dark);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

header::after {
    content: "";
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-2) 100%);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.header-logo {
    height: 32px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.logo-text {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-links a {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    background: #eef2ff;
    color: var(--color-accent-dark);
}

/* Layout */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2.5rem;
    display: flex;
    justify-content: center;
}

.wrap {
    width: 100%;
    max-width: 460px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* The first card on a page is the hero — give it the site's lifted treatment. */
.card.hero-card {
    box-shadow: var(--shadow-md);
    padding-bottom: 0;
    overflow: hidden;
}

.subtitle {
    color: var(--color-muted);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

/* Mountain silhouette, same artwork as the main site. */
.mountain-divider {
    width: calc(100% + 3rem);
    margin: 1.25rem -1.5rem 0;
    height: 64px;
    background-image:
        linear-gradient(180deg, transparent 0%, rgba(37, 99, 235, 0.05) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 140' preserveAspectRatio='none'%3E%3Cpath d='M0,140 L180,55 L340,105 L520,25 L700,95 L880,45 L1040,100 L1200,60 L1200,140 Z' fill='%232563eb' fill-opacity='0.10'/%3E%3Cpath d='M0,140 L240,85 L460,120 L660,65 L860,115 L1080,75 L1200,110 L1200,140 Z' fill='%2316213e' fill-opacity='0.08'/%3E%3C/svg%3E");
    background-size: cover;
    background-position: bottom;
    background-repeat: no-repeat;
}

/* Buttons */
button {
    font: inherit;
    font-family: var(--font-sans);
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--color-accent-dark);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
}

.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }

.btn-danger {
    color: var(--color-danger);
    border-color: rgba(220, 38, 38, 0.35);
}

.btn-danger:hover {
    border-color: var(--color-danger);
    background: #fef2f2;
}

/* Form controls */
input, select {
    font: inherit;
    font-family: var(--font-sans);
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: white;
    color: var(--color-ink);
    margin-bottom: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input::placeholder { color: #97a0b0; }

select { margin-bottom: 0; }

label[for="vendorLogo"], label[for="eventEntries"] { display: block; margin-bottom: 0.35rem; }
input[type="file"] { padding: 0.55rem; }

/* Attendee passport */
.qr-box {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.75rem 0;
}

.qr-box canvas, .qr-box img { display: block; max-width: 100%; }

.timer-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.6rem;
}

.timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-2) 100%);
    transition: width 1s linear;
}

.stamp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 0.6rem;
}

.stamp {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.3;
    padding: 0.4rem;
    border: 2px dashed var(--color-border);
    background: var(--color-surface-alt);
    color: var(--color-muted);
}

.stamp.collected {
    border: 2px solid var(--color-accent-2);
    background: #ecfdf5;
    color: var(--color-accent-2-dark);
    font-weight: 600;
}

.stamp-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* Dim a booth's logo until its stamp is collected. */
.stamp:not(.collected) .stamp-logo { opacity: 0.4; filter: grayscale(1); }

.stamp-name { line-height: 1.1; }

/* Status chips + messages */
.badge {
    display: inline-block;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.ok { background: #ecfdf5; color: var(--color-accent-2-dark); }
.badge.pending { background: var(--color-surface-alt); color: var(--color-muted); }

.msg {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.msg.success {
    background: #ecfdf5;
    color: var(--color-accent-2-dark);
    border-left: 3px solid var(--color-accent-2);
}

.msg.error {
    background: #fef2f2;
    color: var(--color-danger);
    border-left: 3px solid var(--color-danger);
}

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

code {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-size: 0.85em;
}

#reader { border-radius: var(--radius-md); overflow: hidden; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Admin rows (vendors, attendees) */
.admin-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.admin-row-main { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.attendee-row { flex-direction: column; align-items: stretch; }
.attendee-row .admin-row-main { justify-content: space-between; }
.row-logo { width: 34px; height: 34px; object-fit: contain; border-radius: var(--radius-sm); flex-shrink: 0; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.btn-small { width: auto; padding: 0.4rem 0.8rem; font-size: 0.8rem; }

.attendee-detail { margin-top: 0.5rem; padding-left: 0.6rem; border-left: 2px solid var(--color-border); }

.list-line {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.25rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-border);
}

.list-line:last-child { border-bottom: none; }

/* Wider, flexible admin layout on laptops (attendee/vendor pages stay narrow). */
.wrap.wide { max-width: 1040px; }
.wrap.wide .unlock-card { max-width: 460px; margin-left: auto; margin-right: auto; }

#panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    align-items: start;
}

#panel .card { margin-bottom: 0; }
.card-wide { grid-column: 1 / -1; } /* data tables span the full width */
.btn-pair { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-pair button { flex: 1 1 auto; }

/* Inline detail panel that expands right under a vendor/attendee row. */
.admin-row-group { border-bottom: 1px solid var(--color-border); }
.admin-row-group .admin-row { border-bottom: none; }

.row-detail {
    margin: 0 0 0.6rem;
    padding: 0.75rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.row-detail .qr-box { margin: 0 auto 0.5rem; max-width: 252px; }
.row-detail .qr-url { word-break: break-all; text-align: center; }

.audit-group { margin-bottom: 0.9rem; }
.audit-group h3 { font-size: 0.9rem; margin-bottom: 0.1rem; }
.audit-note { color: var(--color-muted); font-size: 0.78rem; margin-bottom: 0.4rem; }

.audit-cluster {
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.4rem;
    background: #fdf6ec;
    border-left: 3px solid var(--color-amber);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.line-right { display: inline-flex; align-items: center; gap: 0.5rem; }
.list-line .badge { font-size: 0.72rem; }

.award-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.award-form select { flex: 1 1 180px; }

.consent-text { font-size: 0.78rem; line-height: 1.5; margin: 0.15rem 0 0.75rem; }
.consent-text p { margin: 0 0 0.4rem; }
.consent-text ul { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.consent-text li { margin-bottom: 0.2rem; }

/* Several elements toggle with the `hidden` attribute, which a display rule
   would otherwise silently beat (.check below sets display:flex). */
[hidden] { display: none !important; }

.check {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--color-ink);
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.check input[type="checkbox"] { width: auto; margin: 0.3rem 0 0; flex-shrink: 0; }

/* The mailing-list opt-in only means anything with an email attached, so it
   dims in place rather than vanishing out from under whoever is reading it. */
.check.disabled { color: var(--color-muted); cursor: not-allowed; }
.check.disabled input[type="checkbox"] { cursor: not-allowed; }
.check-hint { margin: -0.5rem 0 0.75rem 1.6rem; font-size: 0.78rem; }

/* Asks for an explicit confirmation at the moment it matters, instead of a
   checkbox sitting there pre-arguing a case nobody has made yet. */
.notice {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-amber);
    border-radius: var(--radius-sm);
    padding: 0.85rem 0.95rem;
    margin-top: 0.85rem;
}

.notice p { margin: 0 0 0.5rem; font-size: 0.88rem; }
.notice .btn-secondary { margin-top: 0.2rem; }

.install-help {
    margin-top: 0.85rem;
    background: var(--color-surface-alt);
    border-radius: var(--radius-sm);
    padding: 0.85rem 0.95rem 0.95rem;
}

.install-help ol { margin: 0 0 0.75rem; padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.6; }
.install-help li { margin-bottom: 0.3rem; }

/* Footer */
footer {
    background: var(--color-navy);
    color: #cbd5e1;
    text-align: center;
    padding: 1.75rem 1.25rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0.3rem 0;
    font-size: 0.85rem;
}

.footer-content a { color: #93b4fb; }
.footer-content a:hover { color: white; }

@media (max-width: 480px) {
    .nav-container { padding: 0.6rem 0.9rem; }
    .logo-text { font-size: 0.95rem; }
    .card { padding: 1.25rem; }
    .mountain-divider { width: calc(100% + 2.5rem); margin: 1rem -1.25rem 0; }
    main { padding: 1rem 0.75rem 2rem; }
}
