/* ICT Crypto — Blazor Demo · matches React demo design exactly */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg:        #0D1117;
  --surface:   #111827;
  --surface-2: #1A2332;
  --surface-3: #1E293B;
  --border:    #1F2937;
  --border-2:  #2D3748;
  --blue:      #1976D2;
  --blue-l:    #42A5F5;
  --blue-h:    #1565C0;
  --green:     #4CAF50;
  --orange:    #FFA726;
  --red:       #EF5350;
  --text:      #E8EAED;
  --text-2:    #9AA5B4;
  --text-3:    #6B7280;
  --radius:    8px;
  --green-t:   #81C784;
  --red-t:     #EF9A9A;
  --orange-t:  #FFB74D;
}

[data-theme="light"] {
  color-scheme: light;
  --bg:        #F0F4F8;
  --surface:   #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-3: #E8EEF4;
  --border:    #E2E8F0;
  --border-2:  #CBD5E1;
  --blue:      #1976D2;
  --blue-l:    #1565C0;
  --blue-h:    #1251A0;
  --green:     #2E7D32;
  --orange:    #E65100;
  --red:       #C62828;
  --text:      #0F172A;
  --text-2:    #475569;
  --text-3:    #94A3B8;
  --green-t:   #2E7D32;
  --red-t:     #C62828;
  --orange-t:  #E65100;
}

html, body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .2s, color .15s;
  font-family: 'Segoe UI', Inter, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ── Page wrapper ── */
.page { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

/* ── Header ── */
.demo-header {
  background: linear-gradient(135deg, #1565C0, #0D47A1);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.demo-header-logo { font-size: 32px; }
.demo-header-title { font-size: 18px; font-weight: 700; color: #fff; }
.demo-header-sub { font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: .06em; color: #fff; }
.demo-theme-btn {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.demo-theme-btn:hover { background: rgba(255,255,255,.28); }

/* ── Tabs ── */
.demo-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 14px 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--blue-l); border-bottom-color: var(--blue); }

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
}
.card-ok    { border-color: #4CAF50; background: rgba(76,175,80,.07); }
.card-exp   { border-color: #EF5350; background: rgba(239,83,80,.07); }
.card-error { border-color: #EF5350; background: rgba(239,83,80,.07); }
.card-s2    { background: var(--surface-2); }

/* ── Buttons ── */
.btn {
  padding: 8px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-p { background: var(--blue); color: #fff; }
.btn-p:hover:not(:disabled) { background: var(--blue-h); }
.btn-s { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-2); }
.btn-s:hover:not(:disabled) { background: var(--border-2); }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ── Layout helpers ── */
.row  { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col  { display: flex; flex-direction: column; gap: 6px; }
.mb8  { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.mt8  { margin-top: 8px; }

/* ── Text styles ── */
.lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  font-weight: 600;
}
.lbl-blue { color: var(--blue-l); }
.val   { font-size: 13px; color: var(--text); }
.muted { color: var(--text-3); font-size: 13px; }
.muted-sm { color: var(--text-3); font-size: 11px; }
.h2   { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.h2-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

/* ── Mono/Code ── */
.mono {
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  word-break: break-all;
  line-height: 1.6;
}
.mono-scroll    { max-height: 120px; overflow: auto; }
.mono-scroll-lg { max-height: 140px; overflow: auto; }
pre.mono { white-space: pre-wrap; font-size: 11px; }

/* ── Textarea ── */
.ta {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}
.ta:focus { border-color: var(--blue-l); }
.ta-mono  { font-family: 'Cascadia Code', Consolas, monospace; font-size: 11px; }
.ta-sm    { padding: 6px 10px; resize: none; }

/* ── Select ── */
.sel {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.sel:focus { border-color: var(--blue-l); }

/* ── Badges ── */
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  display: inline-block;
}
.badge-ok   { background: rgba(76,175,80,.1);   color: var(--green-t); }
.badge-warn { background: rgba(255,167,38,.1);  color: var(--orange-t); }
.badge-exp  { background: rgba(239,83,80,.1);   color: var(--red-t); }
.badge-blue { background: rgba(66,165,245,.1);  color: var(--blue-l); border: 1px solid rgba(66,165,245,.2); font-size: 10px; }
.badge-feat { background: rgba(66,165,245,.12); color: var(--blue-l); border: 1px solid rgba(66,165,245,.2); font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }

/* ── Cert card ── */
.cert-icon    { font-size: 28px; }
.cert-name    { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.cert-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin-top: 4px; }
.cert-eku     { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cert-thumb   { margin-top: 12px; }

/* ── TSP block ── */
.tsp-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.tsp-row   { display: flex; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.tsp-key   { min-width: 130px; }

/* ── Verify card ── */
.verify-ok  { font-weight: 600; color: var(--green-t); margin-bottom: 6px; }
.verify-err { font-weight: 600; color: var(--red-t);   margin-bottom: 6px; }

/* ── License panel ── */
.lic-ok-row   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lic-ok-title { font-weight: 700; font-size: 14px; }
.lic-ok       { color: var(--green-t); }
.lic-exp      { color: var(--red-t); }
.lic-feats    { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.lic-err-title { font-weight: 600; color: var(--red-t); margin-bottom: 8px; }
.lic-actions  { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.lic-manual   { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.lic-select   { margin-bottom: 10px; }

/* ── File picker ── */
.file-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-name   { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-none   { font-size: 13px; color: var(--text-3); font-style: italic; }
.file-reset  { background: none; border: none; cursor: pointer; padding: 2px 4px; color: var(--text-3); line-height: 1; border-radius: 4px; display: inline-flex; align-items: center; }
.file-reset:hover { color: var(--text-2); }

/* ── Status banner ── */
.status-ok  { color: var(--green-t); font-weight: 600; }
.status-err-title { font-weight: 600; color: var(--red-t); margin-bottom: 6px; }

/* ── Error card ── */
.error-bar { color: var(--red-t); margin-bottom: 16px; }

/* ── Certificate warn/selected hint ── */
.cert-hint-warn { color: var(--orange); margin-bottom: 12px; }
.cert-hint-ok   { color: var(--text-2); margin-bottom: 12px; }
.cert-hint-ok b { color: var(--text); }

/* ── PDF result ── */
.pdf-size { color: var(--text-3); font-size: 13px; margin-top: 4px; }

/* ── Detached hint ── */
.detached-hint { color: var(--text-3); margin-top: 8px; font-size: 12px; }

/* ── Code block ── */
.code-card { margin-top: 16px; }

/* ── Spinner overlay ── */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}
.spinner-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.spinner-ring {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-msg {
    color: var(--text-2);
    font-size: 13px;
    text-align: center;
    max-width: 220px;
    line-height: 1.5;
}
