@import url('/assets/css/fonts.css');

:root {
  --bg: #0a0a0c;
  --surface: #111114;
  --card: #131316;
  --card-hover: #18181c;
  --border: rgba(255,255,255,.06);
  --border-hover: rgba(255,255,255,.1);
  --text: #ededed;
  --text-2: #a0a0a0;
  --text-3: #666;
  --accent: #1e9dba;
  --accent-dim: #186785;
  --accent-soft: rgba(24,103,133,.12);
  --green: #36c275;
  --green-soft: rgba(54,194,117,.1);
  --warn: #f0b24a;
  --warn-soft: rgba(240,178,74,.1);
  --danger: #ff5c74;
  --danger-soft: rgba(255,92,116,.08);
  --shadow: 0 8px 32px rgba(0,0,0,.3);
  --r: 12px;
  --rs: 8px;
  --nav-h: 56px;
  --max-w: 1520px;
  --ease: cubic-bezier(.4,0,.2,1);
  /* compat aliases */
  --panel: var(--card);
  --panel-strong: var(--card);
  --panel-light: var(--surface);
  --primary: var(--accent-dim);
  --primary-strong: var(--accent);
  --muted: var(--text-2);
  --success: var(--green);
  --warning: var(--warn);
}

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

html { background: var(--bg); scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .25;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
code { font-family: 'SF Mono', 'Fira Code', Consolas, monospace; font-size: 13px; }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.nav.scrolled {
  background: rgba(10,10,12,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
}
.nav-logo em {
  font-style: normal;
  color: var(--text-3);
  font-weight: 400;
  margin-left: 3px;
}
.nav-r {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-user {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}
.nb {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--rs);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all .2s var(--ease);
  background: transparent;
  cursor: pointer;
}
.nb:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.nb-fill {
  background: var(--accent-dim);
  border-color: transparent;
  color: #fff;
}
.nb-fill:hover {
  background: var(--accent);
  border-color: transparent;
}

/* legacy compat */

/* ===== Footer (unified) ===== */
.footer {
  padding: 28px 24px;
  border-top: 1px solid var(--border);
}
.footer-in {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-l {
  font-size: 12px;
  color: var(--text-3);
}
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a {
  font-size: 12px;
  color: var(--text-3);
  transition: color .2s;
}
.footer-links a:hover {
  color: var(--text-2);
}

.page-wrap { padding-top: var(--nav-h); flex: 1 0 auto; }

@media(max-width:768px){
  .footer-in { flex-direction: column; gap: 10px; text-align: center; }
}

/* ===== Loading Overlay ===== */

.login-loading-overlay.show { display: flex; }

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

/* ===== Page Layout ===== */
.page-wrap {
  flex: 1 0 auto;
  min-height: calc(100vh - var(--nav-h) - 160px);
  padding: calc(var(--nav-h) + 24px) 20px 40px;
  width: min(var(--max-w), calc(100% - 2rem));
  margin: 0 auto;
}

/* ===== Auth Pages ===== */

/* ---- Split layout: brand left, form right ---- */

/* Dot grid on brand side only */

.auth-brand-features {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Form side */

.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-item label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.form-item input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  border-radius: var(--rs);
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  transition: border-color .2s var(--ease);
}

.form-item input:focus {
  border-color: rgba(30,128,166,.5);
  box-shadow: 0 0 0 3px rgba(30,128,166,.08);
}

.form-item input::placeholder { color: var(--text-3); }

/* ===== Buttons ===== */
.cherry-btn {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--rs);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent-dim);
  cursor: pointer;
  transition: all .2s var(--ease);
}

.cherry-btn:hover { background: var(--accent); }

.cherry-btn:active:not(:disabled) { transform: scale(.98); }

.cherry-btn:disabled { opacity: .5; cursor: not-allowed; }

.cherry-btn.secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
}

.cherry-btn.secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.form-msg {
  min-height: 20px;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}

.left-msg { text-align: left; }

/* ===== Auth plain (login/register/change-pw) ===== */

.auth-plain-form { gap: 12px; }

.auth-plain-form .form-item input {
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 15px;
}

/* ===== Status Pills ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.is-success { background: var(--green-soft); color: var(--green); }
.status-pill.is-danger { background: var(--danger-soft); color: var(--danger); }
.status-pill.is-muted { background: var(--accent-soft); color: var(--accent); }

/* ===== Notices ===== */
.notice-line {
  padding: 12px 14px;
  border-radius: var(--rs);
  font-size: 13px;
  line-height: 1.6;
}

.notice-line.warning {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(240,178,74,.12);
}

.notice-line.info {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(24,103,133,.12);
}

/* ===== Dashboard Layout ===== */

.stat-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.section-head h2 { margin: 0; }

.empty-box p,
.notice-line {
  margin: 0;
  color: var(--text-2);
  line-height: 1.7;
}

.sidebar-link {
  padding: 10px 14px;
  border-radius: var(--rs);
  text-decoration: none;
  color: var(--text-2);
  font-size: 14px;
  transition: all .2s var(--ease);
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--accent-soft);
  color: var(--text);
}

/* ===== Dashboard Content ===== */

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.detail-item {
  padding: 14px;
  border-radius: var(--rs);
  background: var(--surface);
  border: 1px solid var(--border);
}

.detail-item span { display: block; margin-bottom: 6px; color: var(--text-3); font-size: 13px; }
.detail-item strong { display: block; line-height: 1.7; word-break: break-all; }

.dashboard-form { display: grid; gap: 16px; }
.form-submit-row { display: flex; align-items: center; justify-content: flex-start; }

/* ===== Tables ===== */

.empty-box {
  padding: 20px;
  border-radius: var(--rs);
  background: var(--surface);
  border: 1px dashed rgba(255,255,255,.08);
}

/* ===== Simple Dashboard ===== */

.simple-alerts {
  border-radius: var(--r);
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
}

.simple-device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: var(--rs);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* ===== Footer (hero_sms_shop style) ===== */

.site-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.site-footer-links a {
  color: var(--text-3);
  font-size: 12px;
  transition: color .2s var(--ease);
}

.site-footer-links a:hover { color: var(--text-2); }

/* ===== Legal pages ===== */

/* ===== Subtle polish ===== */
::selection { background: rgba(24,103,133,.28); color: #fff; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.07); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.12); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.07) transparent; }

/* ===== Responsive ===== */
@media (max-width: 1180px){
  .stats-grid {
    grid-template-columns: 1fr;
  }
  }

@media (max-width: 768px){
  
  
  
  .page-wrap {
    width: calc(100% - 1rem);
    padding: calc(var(--nav-h) + 16px) 0 24px;
  }

      
  
  
  .auth-plain-form .form-item input { height: 44px; font-size: 16px; }
  
    
  
  
  .form-submit-row, .hero-actions { width: 100%; }

  .hero-actions .cherry-btn, .form-submit-row .cherry-btn,
  .feature-box .cherry-btn, .simple-card-head .cherry-btn {
    width: 100%;
  }

  .simple-device-item {
    flex-direction: column;
    align-items: flex-start;
  }

    
  }

/* ===== Fixed footer override (mobile tab bar only) ===== */
@media (max-width: 768px){
  body { padding-bottom: 58px; }
}

.site-footer-links { margin-bottom: 0; gap: 14px; }

@media (max-width: 768px){
  body { padding-bottom: 72px; }

  
  
  }

/* ===== Clean fixed footer (no collapsible) ===== */

.site-footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-footer-links a {
  color: var(--text-3);
  font-size: 12px;
  transition: color .2s var(--ease);
}

.site-footer-links a:hover { color: var(--text-2); }

/* ============================================================
   Page Navigation Progress Bar
   ============================================================ */
.page-progress{position:fixed;top:0;left:0;right:0;height:2px;z-index:9999;pointer-events:none;opacity:0;transition:opacity .2s}
.page-progress.active{opacity:1}
.page-progress-bar{height:100%;background:var(--accent,#1e9dba);border-radius:0 1px 1px 0;box-shadow:0 0 8px rgba(30,157,186,.4);width:0;transition:width .3s cubic-bezier(.4,0,.2,1)}

/* ============================================================
   Wise typography baseline — calt + tight letter-spacing
   Applies to all pages that load style.css (dashboard, profile,
   pay, launcher-login, help). Display-scale title classes get
   the 900 weight + 0.9 line-height treatment.
   ============================================================ */
*, *::before, *::after { font-feature-settings: "calt"; }
body { letter-spacing: -0.108px; }

/* Hero / page-level display titles — if pages use these, get Wise look */
.docs-hero h1,
.guide-article h1,
.dashboard-hero h1,
.profile-hero h1,
.page-display-title,
h1.wise-display {
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
