/* ============================================================================
   SMS Gateway — design system
   Minimalist, light, high-contrast. One accent. Hairline borders, soft shadows.
   Shared by the marketing homepage (index.html) and the dashboard.
   ========================================================================== */

:root {
  /* Neutrals */
  --bg: #FAFAFA;          /* page background (warm off-white) */
  --surface: #FFFFFF;     /* cards, nav */
  --surface-2: #F4F4F5;   /* subtle fills, code blocks */
  --text: #18181B;        /* body */
  --text-strong: #09090B; /* headings */
  --muted: #71717A;       /* secondary text */
  --line: #E4E4E7;        /* 1px hairline dividers/borders */

  /* Single accent */
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-soft: #EEF0FE;

  /* Status (tinted, used by badges/notices) */
  --ok: #15803D;   --ok-soft: #ECFDF3;
  --warn: #B45309; --warn-soft: #FEF6E7;
  --bad: #DC2626;  --bad-soft: #FEECEC;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 32px -12px rgba(16, 24, 40, .14);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 { color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.15; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 24px 24px 72px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 16px; flex-wrap: wrap; }

/* Brand -------------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px;
  color: var(--text-strong); letter-spacing: -0.02em; }
.brand .dot { width: 11px; height: 11px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #8B86F5); }
.brand .logo { width: 26px; height: 26px; display: block; border-radius: 7px; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--surface-2); border-color: #D4D4D8; }
.btn.ghost { background: transparent; color: var(--text-strong); border: 1px solid transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border: 1px solid var(--line); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.lg { padding: 13px 24px; font-size: 15px; }

/* Forms -------------------------------------------------------------------- */
input, select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: #A1A1AA; }
label { display: block; font-size: 13px; font-weight: 550; color: var(--text); margin: 14px 0 6px; }

/* Cards & layout ----------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.spacer { height: 18px; }
.stack > * + * { margin-top: 10px; }

/* ==========================================================================
   NAVBAR  (homepage)
   ========================================================================== */
.nav { position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .8); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text-strong); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero { text-align: center; padding: 56px 0 28px; }   /* legacy fallback */
.hero h1 { font-size: 40px; margin: 10px 0; }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto; }

.hero-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 72px 24px 48px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #DDE0FB;
  padding: 5px 12px; border-radius: 999px; }
.hero-grid h1 { font-size: clamp(34px, 5vw, 52px); margin: 20px 0 16px; font-weight: 700; }
.hero-lead { font-size: 18px; color: var(--muted); max-width: 46ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; }
}

/* ==========================================================================
   AUTH CARD (homepage)
   ========================================================================== */
.auth-wrap { width: 100%; }
.auth-wrap .card { box-shadow: var(--shadow); padding: 26px; }
.tabs { display: flex; gap: 6px; padding: 4px; margin-bottom: 18px;
  background: var(--surface-2); border-radius: 10px; }
.tabs button { flex: 1; background: transparent; border: 0; color: var(--muted);
  padding: 9px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 14px;
  font-family: inherit; transition: all .15s ease; }
.tabs button.active { color: var(--text-strong); background: var(--surface); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   SECTIONS: features, steps, code, social proof
   ========================================================================== */
.section { max-width: var(--maxw); margin: 0 auto; padding: 72px 24px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(26px, 3.5vw, 34px); margin: 0 0 12px; }
.section-head p { color: var(--muted); font-size: 16px; margin: 0; }
.divider { height: 1px; background: var(--line); border: 0; max-width: var(--maxw); margin: 0 auto; }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 920px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 16px; margin: 0 0 6px; }
.feature-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* Legacy feature-row (kept for compatibility) */
.feature-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; width: 210px; }
.feature b { display: block; margin-bottom: 4px; color: var(--text-strong); }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
@media (max-width: 920px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps-grid { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 44px; }
.step::before { counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--text-strong); color: #fff; font-weight: 700; font-size: 14px; }
.step h4 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* Code showcase */
.code-wrap { max-width: 760px; margin: 0 auto; background: #0B0B0F; border: 1px solid #1F1F27;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #1F1F27; }
.code-bar .d { width: 11px; height: 11px; border-radius: 50%; background: #2A2A33; }
.code-wrap pre { margin: 0; padding: 20px; overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; line-height: 1.7; color: #D4D4D8; }
.code-wrap .k { color: #8B86F5; } .code-wrap .s { color: #86EFAC; } .code-wrap .c { color: #71717A; }

/* Social proof / logo cloud */
.proof { text-align: center; }
.proof .label { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 24px; }
.logos { display: flex; flex-wrap: wrap; gap: 44px; justify-content: center; align-items: center;
  opacity: .72; }
.logos span { font-weight: 700; font-size: 18px; color: var(--muted); letter-spacing: -.01em; }
.quote { max-width: 720px; margin: 0 auto; text-align: center; }
.quote p { font-size: clamp(20px, 2.6vw, 26px); font-weight: 500; color: var(--text-strong);
  letter-spacing: -.01em; line-height: 1.4; margin: 0 0 20px; }
.quote .by { color: var(--muted); font-size: 14px; }

/* CTA band */
.cta-band { max-width: var(--maxw); margin: 0 auto; }
.cta-inner { background: var(--text-strong); color: #fff; border-radius: 18px;
  padding: 56px 40px; text-align: center; }
.cta-inner h2 { color: #fff; font-size: clamp(26px, 3.5vw, 34px); margin: 0 0 12px; }
.cta-inner p { color: #A1A1AA; margin: 0 0 28px; }
.cta-inner .btn.secondary { background: #fff; color: var(--text-strong); border-color: #fff; }
.cta-inner .btn.secondary:hover { background: #E4E4E7; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 56px 24px 40px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  margin: 0 0 14px; font-weight: 600; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; }
.footer li a { color: var(--text); font-size: 14px; }
.footer li a:hover { color: var(--accent); }
.footer .about p { color: var(--muted); font-size: 14px; max-width: 32ch; margin: 14px 0 18px; }
.news { display: flex; gap: 8px; max-width: 320px; }
.news input { padding: 9px 12px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--muted); }
.socials a:hover { color: var(--text-strong); border-color: #D4D4D8; }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom-inner { max-width: var(--maxw); margin: 0 auto; padding: 20px 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: var(--muted); font-size: 13px; }

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; }
.section-title h2 { margin: 0; font-size: 17px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-block;
  border: 1px solid transparent; }
.badge.on { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: var(--surface-2); color: var(--muted); }
.badge.PENDING, .badge.DISPATCHED_TO_DEVICE { background: var(--warn-soft); color: var(--warn); }
.badge.SENT_BY_CARRIER, .badge.DELIVERED { background: var(--ok-soft); color: var(--ok); }
.badge.FAILED { background: var(--bad-soft); color: var(--bad); }

.secret { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2);
  border: 1px dashed var(--accent); color: var(--text-strong);
  padding: 12px; border-radius: 10px; word-break: break-all; font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }

.notice { padding: 11px 13px; border-radius: 10px; margin: 10px 0; font-size: 13px; border: 1px solid transparent; }
.notice.err { background: var(--bad-soft); color: var(--bad); border-color: #F6C9C9; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: #BBF7D0; }

.steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* In-dashboard getting-started / instruction cards */
.guide-steps { margin-top: 18px; }
.guide-steps .step h4 { font-size: 14px; }
.guide-steps .step p { font-size: 13px; }
.guide-link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; }

.modal-bg { position: fixed; inset: 0; background: rgba(9, 9, 11, .5); display: none;
  align-items: center; justify-content: center; padding: 16px; z-index: 50; backdrop-filter: blur(2px); }
.modal-bg.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px; max-width: 520px; width: 100%; box-shadow: var(--shadow); }

@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

/* Wide tables scroll horizontally on small screens instead of cramping. */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 480px; }

/* ==========================================================================
   DASHBOARD SHELL (sidebar menu + section panels)
   ========================================================================== */
.dash { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface);
  border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; }
.sidebar .brand { padding: 2px 8px 22px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--muted); font-family: inherit; font-size: 14px;
  font-weight: 550; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: background .12s ease, color .12s ease; }
.side-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-nav a:hover { background: var(--surface-2); color: var(--text-strong); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; }
.side-foot .who { font-size: 13px; color: var(--muted); padding: 0 8px 12px; line-height: 1.4; }

.main { padding: 30px 36px 72px; max-width: 1060px; width: 100%; }
.main-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; }
.main-head h1 { font-size: 22px; margin: 0; }
.panel { display: none; }
.panel.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 550; }
.stat .v { font-size: 28px; font-weight: 700; color: var(--text-strong); letter-spacing: -.02em; margin-top: 8px; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--muted); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  transition: width .4s ease; }

@media (max-width: 820px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 20; padding: 12px; }
  .sidebar .brand { padding: 4px 8px 12px; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .side-nav a { white-space: nowrap; }
  .side-nav a span.lbl { display: inline; }
  .side-foot { display: flex; align-items: center; justify-content: space-between; border-top: 0; padding-top: 6px; }
  .side-foot .who { padding: 0; }
  .main { padding: 20px 16px 56px; }
  .stats { grid-template-columns: 1fr; }
}

/* ==========================================================================
   MOBILE REFINEMENTS (homepage)
   ========================================================================== */
@media (max-width: 600px) {
  .container { padding: 20px 16px 56px; }
  .nav-inner { padding: 12px 16px; gap: 10px; }
  .nav-actions { gap: 8px; }
  .section { padding: 48px 20px; }
  .section-head { margin-bottom: 32px; }
  .hero-grid { padding: 28px 20px 36px; gap: 28px; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { flex: 1 1 auto; }            /* CTAs share the row */
  .cta-inner { padding: 40px 22px; }
  .logos { gap: 26px 32px; }
  .footer-inner { padding: 44px 20px 32px; }
  .card { padding: 20px; }
  .main-head h1 { font-size: 20px; }
}
/* Never allow sideways page scroll on phones. */
@media (max-width: 600px) { html, body { max-width: 100%; overflow-x: hidden; } }

/* ==========================================================================
   PRICING / TIERS (homepage)
   ========================================================================== */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: var(--maxw); margin: 0 auto; }
@media (max-width: 820px) { .pricing { grid-template-columns: 1fr; max-width: 420px; } }
.tier { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.tier.popular { border-color: var(--accent); box-shadow: var(--shadow); }
.tier-badge { position: absolute; top: -11px; left: 24px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .03em; }
.tier h3 { font-size: 18px; margin: 0 0 4px; }
.tier .price { font-size: 30px; font-weight: 700; color: var(--text-strong); letter-spacing: -.02em; margin: 6px 0 18px; }
.tier .price span { font-size: 15px; font-weight: 600; color: var(--muted); }
.tier-feats { list-style: none; margin: 0 0 22px; padding: 0; flex: 1; }
.tier-feats li { font-size: 14px; color: var(--text); padding: 9px 0; border-bottom: 1px solid var(--line); }
.tier-feats li:last-child { border-bottom: 0; }
.tier-feats b { color: var(--text-strong); }

/* ==========================================================================
   API REFERENCE (homepage developers section)
   ========================================================================== */
.api-ref { max-width: 820px; margin: 0 auto; }
.api-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 680px) { .api-meta { grid-template-columns: 1fr; } }
.api-meta > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.api-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.api-h { font-size: 16px; margin: 28px 0 10px; }
.api-ref .table-wrap table { min-width: 520px; }
.api-ref .code-wrap { margin-top: 10px; }
