:root {
  --bg: #0b0c0f;
  --panel: #15171c;
  --card: #1d2027;
  --card-hover: #232733;
  --border: #2a2e38;
  --text: #e9ebef;
  --muted: #9aa1ad;
  --accent: #21c97a;
  --accent-press: #18a663;
  --danger: #ef5a5a;
  --device-frame: #0d0e11;
  --device-screen: #050608;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  width: 760px;
  height: 560px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  overflow: hidden;
  position: relative;
}

/* Badge DEMO mereu vizibil */
#demo-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 50;
  background: rgba(239, 90, 90, 0.14);
  color: #ff8a8a;
  border: 1px solid rgba(239, 90, 90, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  pointer-events: none;
  user-select: none;
}

#wallet {
  display: flex;
  height: 100%;
}

/* ---------- App panel ---------- */
#app-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
}

#app-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.sim-pill {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 999px;
  padding: 3px 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--card-hover);
}
.icon-btn svg { width: 16px; height: 16px; }

.text-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.text-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--card-hover);
  color: var(--accent);
}
.text-btn[hidden] { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-text { display: flex; flex-direction: column; }

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
  flex: none;
}

.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }

#app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.screen { display: flex; flex-direction: column; gap: 13px; animation: fade 0.18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 12.5px; margin: 0; line-height: 1.5; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.hint b { color: var(--accent); }

/* Butoane */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  padding: 11px 14px;
  transition: background 0.15s, transform 0.05s;
}
button:hover { background: var(--card-hover); }
button:active { transform: scale(0.985); }

button.primary {
  background: var(--accent);
  color: #06160f;
  font-weight: 700;
}
button.primary:hover { background: var(--accent-press); }

button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary:disabled:hover { background: var(--accent); }

/* Disclaimer / consent gate */
.disclaimer { text-align: left; }
.disc-icon { font-size: 26px; text-align: center; }
.disc-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.45;
}
.disc-box p { margin: 0 0 7px; }
.disc-box ul { margin: 0; padding-left: 16px; color: var(--muted); }
.disc-box li { margin-bottom: 5px; }
.disc-box li b { color: var(--text); }
.disc-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}
.disc-check input {
  width: 16px; height: 16px; flex: none; margin-top: 1px;
  accent-color: var(--accent); cursor: pointer;
}

/* Demo PIN callout */
.pin-demo-note {
  background: rgba(33, 201, 122, 0.12);
  border: 1px solid rgba(33, 201, 122, 0.4);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.45;
}
.pin-demo-note b { color: var(--accent); font-size: 14px; letter-spacing: 1px; }
.dev-warn b { color: var(--accent); }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
}
button.wide { width: 100%; }

.back {
  align-self: flex-start;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
  font-size: 13px;
}
.back:hover { background: transparent; color: var(--text); }

.actions { display: flex; gap: 10px; }
.actions .primary { flex: 1; }

/* Dashboard */
.total {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}
.total small { color: var(--muted); font-size: 12px; }
.total-amt { font-size: 28px; font-weight: 800; margin-top: 4px; }

.accts { display: flex; flex-direction: column; gap: 8px; }
.acct {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  width: 100%;
}
.acct-ico {
  width: 34px; height: 34px; border-radius: 50%;
  background: #2b2f3a; color: var(--text);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; flex: none;
}
.acct-info { display: flex; flex-direction: column; flex: 1; }
.acct-info small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.acct-usd { color: var(--text); font-weight: 600; }

/* Inputs */
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
input {
  font-family: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
}
input:focus { border-color: var(--accent); }
input.bad { border-color: var(--danger); }

.field-err { color: var(--danger); font-size: 11.5px; margin: -8px 0 0; min-height: 0; }

/* "Everything is simulated" notice (Receive / Send) */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: rgba(255, 184, 107, 0.12);
  border: 1px solid rgba(255, 184, 107, 0.4);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}
.notice-ico { font-size: 14px; flex: none; line-height: 1.3; }
.notice-body { flex: 1; }
.notice-body b { color: #ffb86b; }
.notice-x {
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font-size: 12px;
  flex: none;
  align-self: flex-start;
}
.notice-x:hover { background: transparent; color: var(--text); }

.status { font-size: 12.5px; margin: 4px 0 0; min-height: 16px; }
.status.ok { color: var(--accent); }
.status.err { color: var(--danger); }

/* Receive */
.qr {
  align-self: center;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  line-height: 0;
}
.addr {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--text);
}

/* Quiz */
.q-progress { color: var(--muted); font-size: 12px; }
.q-text { font-size: 15px; font-weight: 600; line-height: 1.45; }
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opt { text-align: left; border: 1px solid var(--border); }
.q-opt.correct { background: rgba(33, 201, 122, 0.15); border-color: var(--accent); }
.q-opt.wrong { background: rgba(239, 90, 90, 0.13); border-color: var(--danger); }
.q-opt:disabled { cursor: default; opacity: 1; }
.q-explain {
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
}
.q-score { font-size: 30px; font-weight: 800; text-align: center; }
.q-score-sub { text-align: center; color: var(--muted); }

.shake { animation: shake 0.32s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* PIN */
.pin-dots {
  display: flex; gap: 9px; justify-content: center; min-height: 16px;
}
.pin-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border);
}
.pin-dots span.on { background: var(--accent); }
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.pin-grid button {
  height: 52px;
  font-size: 20px;
  color: var(--muted);
  display: grid; place-items: center;
}
.pin-actions { display: flex; gap: 10px; }
.pin-actions button { flex: 1; }

/* ---------- Device panel (right column) ---------- */
#device-panel {
  width: 290px;
  flex: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
}
#device-panel[hidden] { display: none; }
.device-card {
  background: var(--device-frame);
  border: 1px solid #23262e;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.device-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.device-name {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.device-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
}
.device-tag {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
}
/* Original hardware-wallet illustration (drawn from scratch, no brand assets) */
.device-body {
  width: 172px;
  margin: 0 auto;
  padding: 12px 12px 14px;
  border-radius: 26px;
  background: linear-gradient(165deg, #20232b 0%, #121318 55%, #0c0d11 100%);
  border: 1px solid #2c303b;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 5px #0e0f13;
  position: relative;
}
.device-sensor {
  width: 32px; height: 4px; border-radius: 3px;
  background: #34394550; margin: 1px auto 11px;
}
.device-screen {
  background: var(--device-screen);
  border-radius: 11px;
  padding: 14px 12px;
  min-height: 168px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px #1c1f27, inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.device-home {
  width: 32px; height: 32px; margin: 13px auto 0;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 38%, #23262f, #111216);
  border: 1px solid #2c303b;
  position: relative;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.device-home::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--muted); opacity: 0.45;
}
.device-controls { display: flex; gap: 8px; margin-top: 10px; }
.dev-btn { flex: 1; padding: 10px; font-size: 12px; font-weight: 600; position: relative; overflow: hidden; }
.dev-reject { background: #2a1c1f; color: #ff9a9a; }
.dev-reject:hover { background: #371f24; }
.dev-confirm { background: var(--accent); color: #06160f; }
.dev-btn-label { position: relative; z-index: 2; }
.dev-fill {
  position: absolute; inset: 0; left: 0;
  background: var(--accent-press);
  width: 0%;
  z-index: 1;
}
.dev-confirm.holding .dev-fill {
  width: 100%;
  transition: width 0.75s linear;
}

/* Device screen content */
.dev-idle { margin: auto; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.dev-logo { display: grid; place-items: center; }
.dev-logo svg { width: 44px; height: 44px; }
.dev-idle-text { color: var(--muted); font-size: 12px; }

.dev-title { color: var(--text); font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.dev-rows { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.dev-row { display: flex; flex-direction: column; gap: 2px; }
.dev-row-k { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.dev-row-v {
  color: var(--text); font-size: 11px;
  font-family: ui-monospace, Menlo, monospace; word-break: break-all;
}
.dev-hint { color: var(--accent); font-size: 10.5px; margin-top: auto; padding-top: 10px; }

.dev-pin-title { color: var(--text); font-weight: 700; font-size: 13px; margin-bottom: 11px; }
.dev-pin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin: auto; max-width: 168px; width: 100%;
}
.dev-pin-grid span {
  background: #14161b; border-radius: 8px;
  padding: 9px 0; font-size: 17px; color: var(--text); font-weight: 600;
}
.dev-warn { color: #ffb86b; font-size: 10.5px; margin-top: 12px; }

/* ---------- Splash popup ---------- */
body.splash {
  width: 340px;
  height: auto;
  min-height: 0;
  padding: 22px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.splash-device {
  width: 100%;
}
.splash-device .device-body {
  width: 148px;
  padding: 10px 10px 12px;
  border-radius: 22px;
}
.splash-device .device-screen {
  min-height: 120px;
  padding: 12px 10px;
}
.splash-device .device-home {
  width: 28px;
  height: 28px;
  margin-top: 11px;
  border-radius: 9px;
}
.splash-device .dev-logo svg {
  width: 36px;
  height: 36px;
}
.splash-loading {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  animation: splash-pulse 1.4s ease-in-out infinite;
}
.splash-dots {
  display: inline-block;
  min-width: 1.1em;
}
@keyframes splash-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* ---------- Full panel (index.html) ---------- */
body.page {
  width: auto;
  height: auto;
  min-height: 100vh;
  overflow: auto;
}
body.page #wallet {
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  height: auto;
}
body.page #app-panel { min-height: 100vh; }
body.page #app-content { overflow: visible; }
