@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #f9fafb;
  --bg-2: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: rgba(15, 30, 60, 0.09);
  --border-md: rgba(15, 30, 60, 0.14);
  --text: #0d1b2e;
  --text-2: #4a5568;
  --text-3: #8898a8;
  --accent: #1a56db;
  --accent-light: rgba(26, 86, 219, 0.08);
  --accent-mid: rgba(26, 86, 219, 0.18);
  --green: #0c7a4a;
  --green-bg: rgba(12, 122, 74, 0.08);
  --amber: #92400e;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --red: #991b1b;
  --red-bg: rgba(239, 68, 68, 0.08);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 4px rgba(10, 25, 55, 0.06), 0 0 0 1px rgba(10, 25, 55, 0.04);
  --shadow: 0 4px 20px rgba(10, 25, 55, 0.08), 0 0 0 1px rgba(10, 25, 55, 0.05);
  --shadow-lg: 0 16px 48px rgba(10, 25, 55, 0.12), 0 0 0 1px rgba(10, 25, 55, 0.06);
  --font: 'Sora', system-ui, -apple-system, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'JetBrains Mono', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.container { width: min(1140px, 92%); margin: 0 auto; }

/* ─── Navbar ─── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; height: 64px;
  background: rgba(249, 250, 251, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font); font-weight: 800; font-size: 19px;
  letter-spacing: -0.04em; color: var(--text);
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: var(--text-2); padding: 8px 14px; border-radius: 10px;
  transition: all 0.18s ease;
}
.nav-links a:hover { color: var(--text); background: var(--border); }
.nav-links a.active { color: var(--accent); background: var(--accent-light); }
.nav-links a.btn-nav {
  background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(26,86,219,0.25);
}
.nav-links a.btn-nav:hover { background: #1648c0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius); padding: 12px 22px;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.18s ease; white-space: nowrap;
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 14px rgba(26,86,219,0.28);
  letter-spacing: -0.01em;
}
.btn:hover { background: #1648c0; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,86,219,0.32); }
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-md); box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { border-color: rgba(15,30,60,0.22); background: var(--bg-2); transform: translateY(-1px); }
.btn.success {
  background: var(--green); box-shadow: 0 4px 14px rgba(12,122,74,0.22);
}
.btn.success:hover { background: #0a6840; }
.btn.danger {
  background: transparent; color: var(--red);
  border: 1px solid rgba(239,68,68,0.25); box-shadow: none;
}
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }

/* ─── Hero ─── */
.hero {
  padding: 90px 0 72px;
  background: linear-gradient(170deg, #f0f4ff 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(26,86,219,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 70%);
}

.hero-grid {
  position: relative; display: grid;
  grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-md);
  padding: 6px 14px 6px 8px; border-radius: 999px;
  font-family: var(--font); font-size: 12px; font-weight: 700;
  color: var(--text-2); margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.hero-badge-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-light);
  display: grid; place-items: center;
}
.hero-badge-dot::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}

h1 {
  font-family: var(--font); font-size: clamp(36px, 5.5vw, 62px);
  font-weight: 800; line-height: 1.06; letter-spacing: -0.05em;
  color: var(--text); margin-bottom: 20px;
}
h1 span { color: var(--accent); }

.hero-sub {
  font-size: 17px; color: var(--text-2);
  max-width: 600px; margin-bottom: 34px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }

.hero-stats {
  display: flex; gap: 28px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.hero-stat { }
.hero-stat strong {
  display: block; font-family: var(--font);
  font-size: 22px; font-weight: 800; letter-spacing: -0.04em; color: var(--text);
}
.hero-stat span { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* Terminal card */
.terminal-card {
  background: #0d1b2e;
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: 0 24px 60px rgba(10,25,55,0.2), 0 0 0 1px rgba(255,255,255,0.04);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-dot:nth-child(1) { background: #ff5f57; }
.t-dot:nth-child(2) { background: #febc2e; }
.t-dot:nth-child(3) { background: #28c840; }
.terminal-file {
  margin-left: 8px; font-family: var(--font-mono);
  font-size: 12px; color: rgba(255,255,255,0.35);
}
.terminal-body {
  padding: 24px; font-family: var(--font-mono);
  font-size: 13px; line-height: 2; color: #a8b8cc;
}
.t-comment { color: rgba(255,255,255,0.25); }
.t-blue { color: #7eb8f7; }
.t-green { color: #7de2ac; }
.t-yellow { color: #f7c96e; }
.t-purple { color: #c9a9f7; }
.t-white { color: rgba(255,255,255,0.85); }

/* ─── Sections ─── */
.section { padding: 80px 0; }
.section.tight { padding: 48px 0; }
.section.border-top { border-top: 1px solid var(--border); }

.section-label {
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}

h2 {
  font-family: var(--font); font-size: clamp(26px, 3.8vw, 42px);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.04em; color: var(--text);
}
h3 {
  font-family: var(--font); font-size: 18px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text); margin-bottom: 8px;
}

.section-intro { text-align: center; max-width: 600px; margin: 0 auto 52px; }
.section-intro h2 { margin-bottom: 14px; }
.section-intro p { color: var(--text-2); font-size: 16px; line-height: 1.7; }

/* ─── Grid & Cards ─── */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: all 0.2s ease;
}
.card:hover { border-color: var(--border-md); box-shadow: var(--shadow); transform: translateY(-2px); }

.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-light); border: 1px solid var(--accent-mid);
  display: grid; place-items: center; margin-bottom: 18px;
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 500; color: var(--accent);
}
.card p { color: var(--text-2); font-size: 14.5px; line-height: 1.65; }

/* ─── Timeline ─── */
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; top: 28px; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-md) 20%, var(--border-md) 80%, transparent);
}
.step {
  padding: 0 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--text-2); margin-bottom: 16px; position: relative; z-index: 1;
}
.step.active .step-num {
  background: var(--accent); border-color: var(--accent);
  color: #fff; box-shadow: 0 0 0 4px var(--accent-light);
}
.step h4 { font-family: var(--font); font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.step p { color: var(--text-3); font-size: 12.5px; line-height: 1.5; }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 5%; background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font); font-size: 16px; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text);
}
.footer p { color: var(--text-3); font-size: 13px; }

/* ─── Auth / Form pages ─── */
.auth-page {
  min-height: 100vh; display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 5%;
}
.auth-panel.left {
  background: #0d1b2e;
  padding: 60px;
}
.auth-panel.right { background: var(--bg); }

.auth-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font); font-weight: 800; font-size: 18px;
  color: #fff; margin-bottom: 52px;
}
.auth-brand .logo-mark { background: rgba(255,255,255,0.12); }

.auth-headline {
  font-family: var(--font); font-size: 32px; font-weight: 800;
  line-height: 1.12; letter-spacing: -0.04em; color: #fff;
  margin-bottom: 16px;
}
.auth-sub { font-size: 15px; color: rgba(255,255,255,0.45); line-height: 1.65; }

.auth-feature-list { margin-top: 44px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.6); font-size: 14px;
}
.auth-feature-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid; place-items: center; font-size: 14px;
}

.form-wrap {
  width: 100%; max-width: 440px; margin: 0 auto;
}
.form-eyebrow {
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.form-title {
  font-family: var(--font); font-size: 28px; font-weight: 800;
  letter-spacing: -0.04em; color: var(--text); margin-bottom: 6px;
}
.form-sub { color: var(--text-2); font-size: 14.5px; margin-bottom: 28px; }

.notice {
  background: var(--accent-light); border: 1px solid var(--accent-mid);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 13.5px; color: var(--accent); margin-bottom: 22px;
  line-height: 1.6;
}

.input-group { margin-bottom: 18px; }
label {
  display: block; margin-bottom: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
}
input, select, textarea {
  width: 100%; border: 1.5px solid var(--border-md);
  border-radius: var(--radius); background: var(--surface);
  color: var(--text); padding: 11px 14px;
  font-size: 14.5px; outline: none;
  transition: all 0.18s ease;
  -webkit-appearance: none;
}
input::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(26,86,219,0.5);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
input[readonly] { background: var(--bg-2); color: var(--text-2); cursor: not-allowed; }
textarea { min-height: 110px; resize: vertical; }

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.checkbox-list { display: flex; flex-direction: column; gap: 11px; margin-bottom: 22px; }
.checkbox-list label {
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 500; color: var(--text-2); cursor: pointer; margin: 0;
}
.checkbox-list input[type="checkbox"] {
  width: 16px; height: 16px; border-radius: 5px;
  flex-shrink: 0; margin-top: 2px; cursor: pointer; padding: 0;
  accent-color: var(--accent);
}

.btn-full { width: 100%; }
.auth-switch {
  text-align: center; margin-top: 22px;
  font-size: 13.5px; color: var(--text-2); font-weight: 500;
}
.auth-switch a { color: var(--accent); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }

.message {
  display: none; margin-top: 16px;
  padding: 13px 16px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
}

/* ─── Dashboard ─── */
.page-shell { padding: 44px 0 80px; }

.page-header { margin-bottom: 32px; }
.page-header .section-label { margin-bottom: 4px; }
.page-header h2 { font-size: 28px; margin-bottom: 4px; }
.page-header p { color: var(--text-2); font-size: 15px; }

.dashboard-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--font); font-size: 13px; font-weight: 700;
}
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.status-pending { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.status-pending::before { background: #f59e0b; }
.status-ok { background: var(--green-bg); color: var(--green); border: 1px solid rgba(12,122,74,0.2); }
.status-ok::before { background: #0c7a4a; }

.checklist { list-style: none; margin-top: 12px; }
.checklist li {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  color: var(--text-2); font-size: 14.5px;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: '✓'; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; border: 1px solid rgba(12,122,74,0.2);
}

.card-action-icon {
  width: 48px; height: 48px; border-radius: 14px;
  border: 1px solid var(--border-md);
  display: grid; place-items: center;
  font-family: var(--font); font-size: 12.5px; font-weight: 700;
  color: var(--text-2); margin-bottom: 16px; background: var(--bg-2);
}

/* ─── QR Box ─── */
.qr-box {
  width: 100%;
  min-height: 280px;
  border: 1.5px dashed var(--border-md);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 26px;
  padding: 28px;
  overflow: visible;
}

.qr-box img {
  width: 260px;
  height: 260px;
  max-width: 100%;
  object-fit: contain;
  background: #fff;
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(10, 25, 55, 0.12);
  display: block;
  margin: 0 auto;
}

/* ─── Admin ─── */
.admin-section { margin-bottom: 28px; }
.admin-section h3 { font-size: 16px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table {
  width: 100%; border-collapse: collapse; min-width: 720px;
}
.table th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  font-family: var(--font); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2);
  white-space: nowrap;
}
.table td {
  text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text); vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-2); }

.select-status {
  min-width: 148px; padding: 8px 12px;
  border-radius: 10px; font-size: 13px;
}
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex; padding: 4px 10px;
  border-radius: 999px; font-family: var(--font);
  font-size: 11.5px; font-weight: 700;
}
.badge-pending { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.22); }
.badge-ok { background: var(--green-bg); color: var(--green); border: 1px solid rgba(12,122,74,0.2); }
.badge-bad { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

.admin-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 28px;
}

/* ─── Simple form layout (non-split) ─── */
.simple-form-page {
  min-height: calc(100vh - 64px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 52px 5% 80px;
}
.simple-form-card {
  width: min(680px, 100%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px;
  box-shadow: var(--shadow);
}
.simple-form-card.wide { width: min(820px, 100%); }

/* ─── Divider ─── */
.divider { height: 1px; background: var(--border); margin: 28px 0; }

/* ─── Responsive ─── */
@media (max-width: 960px) {
  .hero-grid, .grid-2, .grid-3, .dashboard-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 0; }
  .timeline::before { display: none; }
  .step { flex-direction: row; text-align: left; align-items: flex-start; padding: 14px 0; }
  .step-num { margin: 0 14px 0 0; flex-shrink: 0; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel.left { display: none; }
  .auth-panel.right { padding: 48px 5%; }
  .hero { padding: 60px 0 52px; }
}
@media (max-width: 640px) {
  .navbar { padding: 0 4%; }
  .nav-links a { padding: 7px 10px; font-size: 13px; }
  .footer { flex-direction: column; text-align: center; }
  .simple-form-card { padding: 28px 22px; }
  .input-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
}

/* Native checkbox fix */
input[type="checkbox"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  cursor: pointer;
  accent-color: #2563eb;
  pointer-events: auto !important;
}


/* ===== FINAL CHECKBOX FIX: keep native clickable checkboxes ===== */
.checkbox-list label {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.checkbox-list input[type="checkbox"],
input[type="checkbox"][name="confirmations"] {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  -moz-appearance: checkbox !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  position: static !important;
  z-index: auto !important;
  accent-color: #2563eb !important;
  margin: 0 12px 0 0 !important;
  vertical-align: middle !important;
}

/* ===== Admin Dashboard Counter Cards ===== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 26px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.stat-card span {
  display: block;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card strong {
  display: block;
  color: var(--text-1);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

@media (max-width: 900px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* ─── Payment QR image and UPI copy row ─── */
.qr-box img {
  width: min(240px, 100%);
  height: auto;
  display: block;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.upi-copy-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.upi-copy-row input {
  flex: 1;
}

@media (max-width: 560px) {
  .upi-copy-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* =========================================================
   MOBILE FRIENDLY RESPONSIVE UPGRADE
   Added for Cloud Era / OwnBus portal
   ========================================================= */

/* Prevent horizontal overflow on small screens */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Images and media */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Tablet adjustments */
@media (max-width: 1024px) {
  .container {
    width: min(94%, 960px);
  }

  .hero {
    padding: 64px 0 56px;
  }

  .hero-grid,
  .grid-2,
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .timeline::before {
    display: none;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-panel.left {
    min-height: auto;
    padding: 42px 6%;
  }

  .auth-panel.right {
    padding: 42px 6%;
  }

  .terminal-card {
    max-width: 100%;
  }
}

/* Mobile layout */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .navbar {
    height: auto;
    min-height: 64px;
    padding: 12px 4%;
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .logo {
    font-size: 18px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
  }

  .nav-links {
    width: 100%;
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .hero {
    padding: 48px 0 42px;
  }

  h1 {
    font-size: clamp(32px, 11vw, 44px);
    line-height: 1.08;
  }

  h2 {
    font-size: clamp(24px, 8vw, 32px);
  }

  .hero-sub,
  .section-intro p {
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .btn,
  .btn-full {
    width: 100%;
  }

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

  .terminal-body {
    padding: 18px;
    font-size: 11.5px;
    overflow-x: auto;
  }

  .section {
    padding: 54px 0;
  }

  .section.tight {
    padding: 36px 0;
  }

  .grid-3,
  .grid-2,
  .dashboard-grid,
  .input-row {
    grid-template-columns: 1fr !important;
  }

  .card,
  .simple-form-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .simple-form-page {
    padding: 24px 12px 48px;
  }

  .simple-form-card,
  .simple-form-card.wide,
  .form-wrap {
    width: 100%;
    max-width: 100%;
  }

  .form-title {
    font-size: 24px;
  }

  input,
  select,
  textarea {
    font-size: 16px; /* prevents iOS zoom */
    min-height: 46px;
  }

  .checkbox-list {
    gap: 14px;
  }

  .checkbox-list label {
    align-items: flex-start;
    line-height: 1.45;
    font-size: 14px;
  }

  .checkbox-list input[type="checkbox"],
  input[type="checkbox"][name="confirmations"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin-top: 1px !important;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .admin-topbar .btn {
    width: 100%;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card strong {
    font-size: 28px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 760px;
  }

  .action-row {
    flex-wrap: wrap;
  }

  .qr-box {
    padding: 22px !important;
    margin: 20px 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .qr-box img {
    width: min(220px, 88vw) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .upi-copy-row {
    flex-direction: column;
    align-items: stretch;
  }

  .upi-copy-row .btn,
  .upi-copy-row button {
    width: 100%;
  }

  .footer {
    padding: 28px 5%;
    text-align: center;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .container {
    width: 92%;
  }

  .navbar {
    padding: 10px 4%;
  }

  .auth-panel.left,
  .auth-panel.right {
    padding: 32px 5%;
  }

  .auth-headline {
    font-size: 26px;
  }

  .auth-brand {
    margin-bottom: 32px;
  }

  .hero-stats,
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .simple-form-card {
    padding: 20px 16px;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
  }

  .btn.sm {
    width: auto;
    padding: 8px 12px;
  }

  .form-title {
    font-size: 22px;
  }

  .qr-box img {
    width: min(200px, 84vw) !important;
  }

  .section-intro {
    margin-bottom: 32px;
  }

  .timeline {
    grid-template-columns: 1fr;
  }
}


/* ─── Legal pages and support ─── */
.footer-legal-links a {
  color: var(--accent);
  font-weight: 700;
}
.footer-legal-links a:hover { text-decoration: underline; }

.legal-page .container { max-width: 920px; }
.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 42px;
}
.legal-card h1 {
  font-size: clamp(30px, 4vw, 46px);
  margin-bottom: 8px;
}
.legal-card h2 {
  font-size: 20px;
  margin-top: 28px;
  margin-bottom: 8px;
}
.legal-card p {
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 12px;
}
.legal-updated {
  color: var(--text-3) !important;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 24px !important;
}

.whatsapp-support {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.34);
  border: 1px solid rgba(255,255,255,0.35);
}
.whatsapp-support::before {
  content: '✆';
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  font-size: 14px;
}
.whatsapp-support:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(37, 211, 102, 0.42);
}

@media (max-width: 768px) {
  .legal-card { padding: 28px 20px; }
  .whatsapp-support {
    right: 14px;
    bottom: 14px;
    padding: 12px 14px;
    font-size: 12.5px;
  }
}


/* ===== Final Mobile Friendly Patch: iOS + Android ===== */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

input, select, textarea, button {
  font-size: 16px; /* prevents iOS zoom on input focus */
}

.qr-box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
  padding: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.qr-box img {
  width: min(260px, 76vw);
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 10px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.upi-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  min-width: 760px;
}

@media (max-width: 900px) {
  .navbar {
    height: auto;
    min-height: 64px;
    padding: 12px 4%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links a {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 11px;
  }

  .hero-grid,
  .grid-2,
  .grid-3,
  .dashboard-grid,
  .auth-page,
  .input-row {
    grid-template-columns: 1fr !important;
  }

  .hero {
    padding: 56px 0 44px;
  }

  .hero-grid {
    gap: 28px;
  }

  .terminal-card {
    border-radius: 18px;
  }

  .terminal-body {
    font-size: 12px;
    padding: 18px;
    overflow-x: auto;
  }

  .auth-panel.left {
    padding: 36px 5%;
    min-height: auto;
  }

  .auth-panel.right {
    padding: 32px 5%;
  }

  .simple-form-page {
    padding: 24px 12px 80px;
  }

  .simple-form-card,
  .simple-form-card.wide,
  .form-wrap {
    width: 100%;
    max-width: 100%;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .action-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .container {
    width: min(100% - 24px, 1140px);
  }

  h1 {
    font-size: 34px;
  }

  h2,
  .page-header h2 {
    font-size: 24px;
  }

  .form-title {
    font-size: 24px;
  }

  .hero-actions,
  .upi-copy-row,
  .footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .card,
  .simple-form-card,
  .legal-card {
    padding: 20px 16px !important;
    border-radius: 18px;
  }

  .btn,
  .btn-full,
  .upi-copy-row .btn {
    width: 100%;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .qr-box {
    padding: 16px;
    margin: 20px 0;
  }

  .qr-box img {
    width: min(220px, 78vw) !important;
  }

  .checkbox-list label {
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.55;
  }

  .checkbox-list input[type="checkbox"],
  input[type="checkbox"],
  input[name="confirmations"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin-top: 3px !important;
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: var(--accent) !important;
  }

  .whatsapp-support {
    right: 12px;
    bottom: 12px;
    padding: 11px 13px;
    font-size: 12px;
  }
}
