/* ─── Design tokens ──────────────────────────────────────────────────────────── */
:root {
    --brand: #f59e0b;
    --brand-light: #fcd34d;
    --bg: #0f0f13;
    --surface: #1a1a24;
    --surface2: #22222e;
    --border: #2e2e3e;
    --text: #e2e2f0;
    --text-muted: #8888aa;
    --success: #22c55e;
    --success-bg: #052e16;
    --danger: #ef4444;
    --danger-bg: #2d0a0a;
    --radius: 14px;
    --radius-sm: 8px;
    --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --transition: 0.18s ease;
}

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

html, body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
#app { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

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

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
    padding: 4rem 0 2.5rem;
    text-align: center;
}

.hero-icon { font-size: 3rem; margin-bottom: 0.75rem; }

.hero-title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--text);
    margin-bottom: 0.5rem;
}

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

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto 1rem;
}

/* ─── Checker card ────────────────────────────────────────────────────────────── */
.checker-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

/* ─── Mode tabs ────────────────────────────────────────────────────────────────── */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.tab:hover { border-color: var(--brand); color: var(--text); }
.tab.active { border-color: var(--brand); background: rgba(245,158,11,0.1); color: var(--brand-light); }

/* ─── Input row ────────────────────────────────────────────────────────────────── */
.input-row {
    display: flex;
    gap: 0.625rem;
    align-items: stretch;
}

.country-select {
    padding: 0.75rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
    min-width: 120px;
}

.country-select:focus { border-color: var(--brand); }

.vat-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.vat-input::placeholder { color: var(--text-muted); }
.vat-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }

.btn-check {
    padding: 0.75rem 1.75rem;
    background: var(--brand);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-check:hover:not(:disabled) { background: var(--brand-light); transform: translateY(-1px); }
.btn-check:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Inline error ─────────────────────────────────────────────────────────────── */
.inline-error {
    margin-top: 0.875rem;
    padding: 0.625rem 1rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.9rem;
}

/* ─── Spinner ──────────────────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Result card ─────────────────────────────────────────────────────────────── */
.result-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.result-card.valid { border-color: var(--success); background: linear-gradient(135deg, var(--success-bg), var(--surface)); }
.result-card.invalid { border-color: var(--danger); background: linear-gradient(135deg, var(--danger-bg), var(--surface)); }
.result-card.warning { border-color: #f59e0b; background: linear-gradient(135deg, #1a1200, var(--surface)); }

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.result-icon { font-size: 2rem; }

.result-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.result-card.valid .result-status { color: var(--success); }
.result-card.invalid .result-status { color: var(--danger); }
.result-card.warning .result-status { color: var(--brand-light); }

.result-number {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ─── Result sections ─────────────────────────────────────────────────────────── */
.result-section {
    margin-bottom: 1.25rem;
}

.result-section:last-child { margin-bottom: 0; }

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(46,46,62,0.6);
    gap: 1rem;
}

.result-row:last-child { border-bottom: none; }

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 160px;
}

.result-value {
    font-size: 0.95rem;
    color: var(--text);
    text-align: right;
    font-weight: 500;
}

.result-value.address {
    white-space: pre-line;
    text-align: right;
    font-size: 0.875rem;
}

.error-row .result-value { color: #fca5a5; }

/* ─── Examples ─────────────────────────────────────────────────────────────────── */
.examples {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.examples-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.example-btn {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}

.example-btn:hover { border-color: var(--brand); color: var(--brand-light); }

/* ─── Footer ───────────────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Blazor reconnect modal ───────────────────────────────────────────────────── */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    color: #fca5a5;
    font-size: 0.875rem;
    z-index: 1000;
    white-space: nowrap;
}

#blazor-error-ui .reload { color: var(--brand-light); margin-left: 0.75rem; }
#blazor-error-ui .dismiss { margin-left: 0.75rem; cursor: pointer; }

/* ─── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .input-row { flex-direction: column; }
    .country-select { width: 100%; }
    .btn-check { width: 100%; justify-content: center; }
    .result-row { flex-direction: column; gap: 0.25rem; }
    .result-value { text-align: left; }
    .result-label { min-width: unset; }
}
