/* ─────────────────────────────────────────────
   LEDJA Portal — Design System
   Mirrors the mobile app's brand: Deep Indigo + Amber.
   Design tokens (colors/radii/shadows) live in
   tokens.css, shared with the ops-admin dashboard.
   ───────────────────────────────────────────── */

@import url('tokens.css');

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text-1);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ───────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.4px;
  color: var(--primary);
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-3);
}

.nav-links a:hover { color: var(--primary); }

/* ── Hero ──────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(45% 65% at 88% -10%, rgba(245, 158, 11, 0.18), transparent 60%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-2) 55%, var(--primary-3) 100%);
  color: var(--white);
  padding: 64px 0 88px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--accent-100);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 900;
  letter-spacing: -1.2px;
  line-height: 1.12;
  margin: 0 0 16px;
}

.hero h1 .accent-text {
  background: linear-gradient(90deg, var(--accent) 0%, #FCD34D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 480px;
  margin: 0 0 28px;
  line-height: 1.7;
}

.hero-features {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.hero-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-feature .tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 56px; }
}

/* A short marketing strip above a full-width form below it (signup),
   instead of the hero and form competing side-by-side for the same
   narrow column for the whole page — see hero-features-row too. */
.hero-compact { padding: 40px 0 36px; }
.hero-compact .lead { max-width: 640px; }
.hero-compact .hero-features-row {
  display: flex; flex-wrap: wrap; gap: 20px 32px; margin-top: 24px;
}
.hero-compact .hero-features-row .hero-feature { flex: 0 0 auto; }

/* Reusable two-equal-column field layout (name/phone/pin pairs, or two
   whole form sections side by side like Plan | Period+Total+Renewal) —
   only meaningful once a form-card has room to use it, see .form-card-wide. */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* Signup's form-card moves out of the cramped hero-grid column and uses
   the full container width instead, so multi-column field layouts and a
   wider business-type grid actually have room to breathe. */
.form-card-wide { max-width: none; }

/* ── Cards ─────────────────────────────────── */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: relative;
}

.form-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), transparent 40%, rgba(30,27,75,0.08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.form-card h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  color: var(--text-1);
}

.form-card p.hint {
  color: var(--text-3);
  font-size: 13.5px;
  margin: 0 0 24px;
  line-height: 1.6;
}

/* Page (non-hero) wrapper for interior pages */
.page {
  padding: 56px 0;
  min-height: calc(100vh - 68px - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}

.page-icon.success { background: var(--profit-bg); color: var(--profit); }
.page-icon.error   { background: var(--loss-bg); color: var(--loss); }
.page-icon.info    { background: var(--primary-light); color: var(--primary); }

/* Small inline icon (nav links, buttons, list items) — sized to sit
   comfortably next to 13-15px text. */
.icon { font-size: 14px; line-height: 1; }
.icon-circle {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex: none;
}

/* ── Forms ─────────────────────────────────── */

form p { margin: 0 0 16px; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}

input[type=text], input[type=password], input[type=tel],
input[type=number], input[type=email], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-1);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-100);
  background: var(--white);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2364748B' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.errorlist {
  color: var(--loss);
  font-size: 12.5px;
  margin: -10px 0 14px;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.msg-error {
  background: var(--loss-bg);
  color: #B91C1C;
  border: 1px solid var(--loss-bg);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 600;
}

/* Radio "pricing card" group (plan / renewal) */
.radio-cards { display: grid; gap: 10px; margin: 0 0 16px; }

.radio-cards label.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-2);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.radio-cards label.option:hover { border-color: var(--primary-3); }

.radio-cards input[type=radio] {
  margin-top: 2px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: none;
}

.radio-cards label.option.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 3px var(--accent-100);
}

.radio-cards .option-title {
  font-weight: 800;
  color: var(--text-1);
  font-size: 14px;
}

.radio-cards .option-sub {
  font-weight: 500;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
}

/* ── Business-type grid (signup) ──────────── */

.form-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-1);
  margin: 28px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font-size: 11px;
  font-weight: 900;
}

.form-section-hint {
  font-size: 12px;
  color: var(--text-3);
  margin: -2px 0 12px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.type-card:hover { border-color: var(--primary-3); }

.type-card .type-emoji { font-size: 22px; }

.type-card .type-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  line-height: 1.3;
}

.type-card.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 3px var(--accent-100);
}

.type-card.selected .type-label { color: var(--text-1); }

#type-desc {
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 0 0 16px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.chip-group label.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chip-group label.chip:hover { border-color: var(--primary-3); }

.chip-group input[type=checkbox] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.chip-group label.chip.selected {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--text-1);
}

.total-due-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 4px 0 16px;
}

.total-due-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
}

.total-due-amount {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.4px;
}

/* ── Buttons ───────────────────────────────── */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  background: var(--accent);
  color: #1a1206;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  box-shadow: var(--shadow-glow);
}

button:hover, .btn:hover { background: var(--accent-dark); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--primary-light); border-color: var(--primary-3); }

.btn-block-secondary {
  background: var(--white);
  color: var(--text-1);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn-block-secondary:hover { background: var(--surface-2); }

/* ── Stat cards / tables (agent dashboard) ─── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}

/* Two-column layout for dashboard cards (e.g. Subscription + Wallet side
   by side) — same pattern as ops-admin's .admin-grid-2, kept here too
   since portal.css and admin.css are separate stylesheets. */
.dashboard-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .dashboard-grid-2 { grid-template-columns: 1fr; } }

/* Compact inline key:value pills — a denser alternative to a full
   .stat-card when the numbers don't need to dominate the layout. */
.mini-stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 2px 0 14px; }
.mini-stat .mini-stat-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase; color: var(--text-4);
}
.mini-stat .mini-stat-value {
  font-size: 15px; font-weight: 800; color: var(--text-1); margin-top: 1px;
}

.stat-card {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-2) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--accent);
  margin-top: 6px;
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-4);
  margin: 32px 0 12px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

table.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

table.data-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table td[colspan] { color: var(--text-4); text-align: center; padding: 24px; }
table.data-table tbody tr:hover td,
table.data-table tr:hover td { background: var(--surface); transition: background 0.12s; }

.table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-card table.data-table { border: none; border-radius: 0; box-shadow: none; }

.nudge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--accent-50);
  border: 1px solid var(--accent-100);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 18px;
}
.nudge-banner p { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.nudge-banner p i { color: var(--accent-dark); margin-right: 6px; }

.pill {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

/* Status-specific variants — same pill shape, semantic color instead of
   one flat purple for every status regardless of whether it's actually
   good (paid), waiting (pending), or bad (past due/cancelled) news. */
.pill-success { background: var(--profit-bg); color: var(--profit); }
.pill-warning { background: var(--accent-100); color: var(--accent-dark); }
.pill-danger  { background: var(--loss-bg);   color: var(--loss); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral); }

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 12px;
}
.section-title-row .section-title { margin: 0; }

.tab-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.tab-toggle a {
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-4);
  padding: 5px 14px;
  border-radius: 999px;
  text-decoration: none;
}
.tab-toggle a.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-3);
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  margin-top: 6px;
  word-break: break-all;
}

/* ── Footer ────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-4);
}

.footer a { color: var(--text-3); font-weight: 600; }
.footer a:hover { color: var(--primary); }

/* ── Misc ──────────────────────────────────── */

.muted { color: var(--text-3); font-size: 13px; }
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.trust-strip {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.trust-strip .trust-item {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}
.trust-strip .trust-item b { color: rgba(255, 255, 255, 0.9); font-size: 15px; display: block; }
