:root {
    --white: #ffffff;
    --bg: #f5f5f7;
    --text: #1d1d1f;
    --muted: #86868b;
    --border: #d2d2d7;
    --accent: #0066cc;
    --accent-hover: #004499;
    --success: #30d158;
    --danger: #ff453a;
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-shell {
    width: min(720px, calc(100% - 40px));
    margin: 0 auto;
    padding: 40px 0 80px;
}

/* Top bar – minimal, like Apple */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Flashes */
.banner {
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.banner-success {
    background: #e8f8ee;
    color: #1a6e3a;
}

.banner-error {
    background: #fdeaea;
    color: #a83232;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 16px;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
    max-width: 540px;
    margin: 0 auto 28px;
}

/* Code input row */
.code-input-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.code-input-row input {
    width: 200px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: lowercase;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.code-input-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

/* How it works */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.how-step {
    text-align: center;
    padding: 24px 16px;
}

.how-step .icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 14px;
}

.how-step h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
}

.how-step p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

/* Card – single layer, no nesting */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
    margin-bottom: 20px;
}

.card:last-child {
    margin-bottom: 0;
}

.card h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px;
}

.card .sub {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 20px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

input, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1;
}

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

.btn-secondary {
    background: #e8e8ed;
    color: var(--text);
    font-weight: 500;
}

.btn-secondary:hover {
    background: #d2d2d7;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-link {
    background: none;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Code chip */
.code-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: #f5f5f7;
    color: var(--accent);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.15em;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active { background: #e8f0fe; color: var(--accent); }
.badge-pending { background: #f5f0e8; color: #8a6e2a; }
.badge-reported { background: #e8f8ee; color: #1a6e3a; }
.badge-resolved { background: #f5e8e8; color: #a83232; }

/* Stat cards */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.stat-card strong {
    display: block;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    margin: 0 -32px;
    padding: 0 32px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e8e8ed;
}

th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 0;
}

tr:last-child td {
    border-bottom: 0;
}

/* Status detail grid */
.status-grid {
    display: grid;
    gap: 0;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8ed;
    font-size: 14px;
}

.status-row:last-child {
    border-bottom: 0;
}

.status-row .label {
    color: var(--muted);
}

.status-row .value {
    font-weight: 600;
}

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* Two-column layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Address autocomplete */
.address-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}

.address-results.visible {
    display: block;
}

.address-result-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #e8e8ed;
}

.address-result-item:last-child {
    border-bottom: 0;
}

.address-result-item:hover {
    background: #f5f5f7;
}

/* Choice cards (radio buttons as cards) */
.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.choice-card:hover {
    border-color: var(--accent);
    background: #f8faff;
}

.choice-card input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.choice-card:has(input:checked) {
    border-color: var(--accent);
    background: #f0f6ff;
}

/* Step indicator */
.step-indicator {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

/* Step dots */
.step-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
}

.step-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 999px;
}

/* Timeline */
.timeline {
    display: grid;
    gap: 0;
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-left: -20px;
    margin-top: 4px;
    border: 2px solid var(--white);
}

@media (min-width: 900px) {
    .stat-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 680px) {
    .grid-2,
    .stat-row,
    .how-it-works {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 28px;
    }
    .page-shell {
        padding: 20px 0 40px;
    }
    .card {
        padding: 24px;
    }
}
