/* ============================================================
   ATMint — Shared Design System
   Source of truth: dashboard.tmpl
   Apply to: index.html, login.html, register.html,
             pricing.html, trial-ended.html, tos.html,
             about.html, contact.html, dashboard.tmpl
   ============================================================ */

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

/* ── TOKENS: DARK (default) ── */
:root,
[data-theme="dark"] {
  /* Surfaces */
  --bg:       #0d0f14;
  --surface:  #111520;
  --grid:     #1a2030;
  --border:   #1e2530;

  /* Text */
  --text:     #e2e8f0;
  --muted:    #718096;

  /* Semantic colours */
  --accent:   #f0b429;
  --up:       #48bb78;
  --down:     #fc5c65;
  --warn:     #f6ad55;

  /* Derived state backgrounds */
  --up-bg:    #1a3a2a;
  --down-bg:  #3a1a1a;

  /* Data-viz palette */
  --chart-balance: #5591c7;
  --chart-btc:     #fdab43;
}

/* ── TOKENS: LIGHT ── */
body.light,
[data-theme="light"] {
  --bg:       #f0f2f5;
  --surface:  #ffffff;
  --grid:     #e8edf4;
  --border:   #dde1ea;

  --text:     #1a202c;
  --muted:    #4a5568;

  --accent:   #b7791f;
  --up:       #276749;
  --down:     #c53030;
  --warn:     #b7791f;

  --up-bg:    #c6f6d5;
  --down-bg:  #fed7d7;

  --chart-balance: #2b6cb0;
  --chart-btc:     #c05621;
}

/* ── BASE ── */
html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Monospace — used for data values, nav items, pricing page */
.mono { font-family: 'Courier New', monospace; }

/* ── TOPBAR ── */
.topbar {
  height: 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  z-index: 500;
}

body.light .logo-box .logo-int { color: #1a202c; }

.logo-box {
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.045em;
  line-height: 1;
}

.logo-box .logo-atm { color: #ecb42b; }
.logo-box .logo-int { color: #f3f6fb; }

.nav-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  line-height: 1;
  font-size: 16px;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 400;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

#themeBtn {
  width: 36px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  text-decoration: none;
}

#themeBtn:hover { background: var(--border); }

/* ── TICKER ── */
/* WebKit-safe marquee. Animation is PAUSED until JS injects content and forces
   layout: iOS Safari resolves percentage transforms once, when it builds the
   accelerated animation, and never re-resolves them. Starting on an empty box
   permanently bakes in a 0px travel distance. Do not add an unconditional
   `animation-play-state: running`, and do not re-add `!important`. */
.ticker-wrap {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding-left: 8px;
  padding-right: 8px;
  cursor: default;
  position: relative;
  contain: paint;
}

.ticker-inner {
  display: flex;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation-name: tickerMarquee;
  animation-duration: var(--ticker-dur, 54s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-play-state: paused;
}

.ticker-inner.is-running { animation-play-state: running; }

.ticker-seq { display: flex; flex: 0 0 auto; }

.ticker-inner span { margin-right: 32px; }

@keyframes tickerMarquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* iOS latches :hover after a tap and never releases it — real pointers only */
@media (hover: hover) and (pointer: fine) {
  .ticker-wrap:hover .ticker-inner { animation-play-state: paused; }
}

.topbar-right {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  text-decoration: none;
}
.icon-btn:hover { background: var(--border); }

.topbar-meta {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 9px;
  color: var(--muted);
  border-left: 1px solid var(--border);
  gap: 5px;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--up);
  border-radius: 50%;
  margin-right: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── NAV OVERLAY ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}
.nav-overlay.open { display: flex; }

.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 230px;
  max-width: 90vw;
  padding: 0 0 8px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: popIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.93) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.nav-card-header {
  padding: 8px 12px 8px;
  background: var(--grid);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--border);
}

.nav-card-header span {
  color: var(--accent);
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1.5px;
}

.nav-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.nav-close-btn:hover { background: var(--border); color: var(--text); }

.dd-item {
  display: block;
  padding: 10px 20px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Inter', system-ui, sans-serif;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.dd-item.dd-primary {
  color: var(--accent);
  font-weight: bold;
}

.dd-item:hover { background: var(--border); }

.dd-item.danger { color: #fc5c65; }
.dd-item.danger:hover { background: rgba(252, 92, 101, 0.1); }

.dd-item.dd-primary:hover { background: var(--border); }

.dd-sep { height: 1px; background: var(--border); margin: 3px 0; }

/* ── UTILITY COLOUR CLASSES ── */
.up   { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.acc  { color: var(--accent); }

.badge-up   { color: var(--up); }
.badge-down { color: var(--down); }
.badge-warn { color: var(--warn); }
.badge-neu  { color: var(--muted); }

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border-radius: 8px;
  border: none;
  font-family: 'Inter', system-ui;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s;
  text-decoration: none;
  text-align: center;
  font-weight: bold;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary   { background: var(--accent); color: #1a1a2e; }
.btn-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost     { background: transparent; color: var(--muted); border: 1px solid var(--border); font-size: 0.82rem; }
.btn-danger    { background: transparent; color: var(--down); border: 1px solid var(--down); }

/* ── CARDS ── */
.card {
  width: min(100%, 520px);
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); opacity: 0.6; }

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.2rem 0;
}

/* ── STATUS / FEEDBACK ── */
.status-msg {
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1rem;
}
.status-msg.error { color: var(--down); }
.status-msg.success { color: var(--up); }

/* ── PAGE LAYOUT ── */
.page-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

/* ── SOCIAL BAR (footer, shared across public pages) ── */
.social-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  height: 56px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 500;
}

.social-bar .icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

.social-bar .icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--border);
}

.social-bar .icon-btn.social-icon {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}

.social-bar .icon-btn.social-icon svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 767px) {
  .social-bar { height: 48px; gap: 20px; }
}

/* ── BILLING REMINDER BANNER ── */
.billing-reminder-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.billing-reminder-banner.is-hidden {
  display: none;
}

.billing-reminder-copy {
  font-size: 0.85rem;
  line-height: 1.45;
}

.billing-reminder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.billing-reminder-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.billing-reminder-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* ── MAP TOGGLE BUTTONS ── */
.map-tog {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: rgba(13, 15, 20, 0.82);
  backdrop-filter: blur(6px);
  color: var(--muted);
  transition: all 100ms;
}
.map-tog.active { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.map-tog:not(.active):hover { color: var(--text); border-color: var(--muted); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── FOCUS RING ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (max-width: 768px) {
  .card {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .billing-reminder-banner {
    top: 64px;
    flex-direction: column;
    align-items: flex-start;
  }

  .billing-reminder-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 540px) {
  .card {
    padding: 1rem;
    border-radius: 10px;
  }

  .acct-grid {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .acct-field {
    padding: 0.7rem 0.8rem;
  }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  /* Specificity 0,1,0 beats the 0,0,0 universal selector even between two
     !important declarations — this must stay, or the ticker strobes. */
  .ticker-inner {
    animation-name: none !important;
    transform: none !important;
  }
  .live-dot { animation-name: none !important; }
}
