/* ============================================
   Fikua Lab — Issuer
   Light/Dark theme with Fikua Lab design system
   ============================================ */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --text: #334155;
    --text-muted: #64748b;
    --heading: #0f172a;
    --accent: #2A9D8F;
    --accent-hover: #238578;
    --accent-subtle: rgba(42, 157, 143, 0.08);
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --btn-accent-text: #fff;
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    --max-width: 720px;
}

[data-theme="dark"] {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #22263a;
    --border: #2a2e3f;
    --text: #e1e4ed;
    --text-muted: #8b90a0;
    --heading: #e2e8f0;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-subtle: rgba(45, 212, 191, 0.1);
    --primary: #4f8ff7;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --nav-bg: rgba(15, 17, 23, 0.9);
    --btn-accent-text: #0f1117;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }

h1, h2, h3 { color: var(--heading); line-height: 1.3; }

/* --- Theme Toggle --- */
.theme-toggle {
    background: none; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.35rem; cursor: pointer; color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--heading); border-color: var(--text-muted); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
.nav-links { display: flex; align-items: center; gap: 0.75rem; }

/* --- Nav --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    transition: background 0.3s, border-color 0.3s;
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--heading);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.nav-label {
    font-size: 0.8rem;
    font-family: var(--mono);
    color: var(--text-muted);
    background: var(--surface);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* --- Main --- */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

section { margin-bottom: 2.5rem; }

section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-sub {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* --- Identify Section --- */
.identify-section {
    display: flex;
    justify-content: center;
    padding-top: 4rem;
}

.identify-card {
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.identify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--accent-subtle);
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.identify-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.identify-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.identify-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

.identify-status {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.75rem;
}

/* --- Buttons --- */
.btn {
    font-family: var(--font);
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn:hover { background: var(--surface-hover); }

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--btn-accent-text);
    font-weight: 600;
}
.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: var(--radius-lg);
}

/* --- Spinner --- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

/* --- Success --- */
.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    margin-bottom: 1rem;
}

.cert-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
    font-size: 0.8125rem;
    font-family: var(--mono);
}

.cert-info .cert-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
}

.cert-info .cert-row:last-child { border-bottom: none; }
.cert-info .cert-label { color: var(--text-muted); }

/* --- Offers / Issued --- */
.offers-list,
.issued-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.offer-card,
.issued-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offer-card .offer-type {
    font-weight: 600;
    font-size: 0.9rem;
}

.offer-card .offer-status,
.issued-card .issued-status {
    font-size: 0.75rem;
    font-family: var(--mono);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.status-pending { background: rgba(251, 191, 36, 0.1); color: var(--warning); }
.status-issued { background: rgba(52, 211, 153, 0.1); color: var(--success); }

.empty-state {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 2rem;
    text-align: center;
}

.hidden { display: none; }

/* --- Phases --- */
.phase { padding: 1rem 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .identify-section { padding-top: 2rem; }
    main { padding: 1.5rem 1rem; }
}
