@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
    --bg: radial-gradient(circle at 20% 20%, #1f2937, #0f172a 45%);
    --card: #101827;
    --card-2: #0b1220;
    --accent: #10b981;
    --accent-2: #22d3ee;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 18px 80px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    align-items: flex-start;
}

.hero__text h1 {
    margin: 4px 0 6px;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

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

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 11px;
    color: var(--accent-2);
    margin: 0;
}

.hero__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    color: var(--text);
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border: none;
    color: #0b0f18;
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.18);
    background: #111827;
}

.btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--muted);
}

.scanner {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.scanner__camera {
    position: relative;
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: #0b1220;
    min-height: 240px;
    overflow: hidden;
}

.camera__overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.12), transparent 55%);
}

.camera__preview {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(1.1);
}

.hint {
    position: absolute;
    bottom: 10px;
    right: 12px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
}

.upload-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 10px;
}

.status {
    color: var(--muted);
    font-size: 14px;
}

.results {
    margin-top: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.results__header,
.history__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.card {
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    min-height: 76px;
}

.card--raw {
    grid-column: 1 / -1;
}

.label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
}

.value {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.raw {
    white-space: pre-wrap;
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.history {
    margin-top: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.history__actions {
    display: flex;
    gap: 8px;
}

.history__list {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--card-2);
    max-height: 320px;
    overflow-y: auto;
}

.history__list.empty {
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-item:last-child {
    border-bottom: none;
}

.history-item .title {
    margin: 0 0 4px;
    font-weight: 600;
}

.history-item .line {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 700px) {
    .hero {
        flex-direction: column;
    }
    .hero__actions {
        width: 100%;
    }
    .hero__actions .btn {
        width: 100%;
        text-align: center;
    }
}
