/* ==========================================================================
   MACT Portal — Design System
   A judicial-record identity: deep navy + brass seal gold on warm paper.
   Display: "Source Serif 4"  |  Body/UI: "Inter"  |  Data/Codes: "IBM Plex Mono"
   ========================================================================== */

:root {
  /* Palette */
  --navy-950: #0b1b33;
  --navy-900: #0f2340;
  --navy-800: #142b4d;
  --navy-700: #1d3a63;
  --navy-600: #2a4d7f;
  --gold-600: #9c7127;
  --gold-500: #b8863b;
  --gold-400: #cba05a;
  --gold-300: #d9b876;
  --gold-100: #f3e6c8;
  --paper-50: #faf8f2;
  --paper-100: #f4f0e6;
  --paper-200: #ebe4d3;
  --ink-900: #1a1a1a;
  --ink-700: #3d3d3d;
  --ink-500: #6b6b6b;
  --ink-300: #9c9c9c;
  --teal-700: #145c50;
  --teal-600: #1f7a6c;
  --teal-100: #dcf0ec;
  --amber-600: #a3671c;
  --amber-100: #faedd6;
  --red-700: #8a2b2b;
  --red-600: #b23a3a;
  --red-100: #f8e3e3;
  --blue-600: #2a4d7f;
  --blue-100: #e2eaf5;
  --purple-600: #5b3f8c;
  --purple-100: #ece4f7;
  --grey-600: #6b6b6b;
  --grey-100: #ececec;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(11, 27, 51, 0.06), 0 4px 16px rgba(11, 27, 51, 0.06);
  --shadow-pop: 0 8px 30px rgba(11, 27, 51, 0.16);

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper-100);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-950);
  margin: 0 0 0.4em;
  line-height: 1.2;
  font-weight: 600;
}

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-600); }

code, .mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); color: #fff; box-shadow: var(--shadow-card); }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-400); color: var(--navy-950); }
.btn-outline { background: transparent; border-color: var(--navy-700); color: var(--navy-800); }
.btn-outline:hover { background: var(--navy-950); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy-700); }
.btn-ghost:hover { background: var(--paper-200); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------
   Top public nav (marketing / landing pages)
   --------------------------------------------------------------- */
.topnav {
  background: var(--navy-950);
  color: #fff;
  border-bottom: 3px solid var(--gold-500);
}
.topnav .container { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-seal {
  width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-300), var(--gold-600));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--navy-950); font-size: 18px;
  border: 2px solid var(--gold-100);
}
.brand-text .title { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.brand-text .subtitle { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-300); }
.topnav nav a { color: var(--paper-100); margin-left: 26px; font-size: 14.5px; font-weight: 500; }
.topnav nav a:hover { color: var(--gold-300); }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(184,134,59,0.18), transparent 60%),
    linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: #fff;
  padding: 76px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 120px);
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-300); border: 1px solid rgba(217,184,118,0.4);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 {
  color: #fff; font-size: clamp(32px, 4.4vw, 52px); max-width: 760px; margin-bottom: 18px;
}
.hero p.lead { color: #cfd8e6; font-size: 17.5px; max-width: 620px; margin-bottom: 34px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  margin-top: 56px; overflow: hidden;
}
.hero-stats .stat { background: rgba(255,255,255,0.03); padding: 22px 20px; }
.hero-stats .stat .num { font-family: var(--font-display); font-size: 28px; color: var(--gold-300); }
.hero-stats .stat .label { font-size: 12.5px; color: #b9c3d4; margin-top: 4px; }

/* ---------------------------------------------------------------
   Section / cards on landing page
   --------------------------------------------------------------- */
.section { padding: 72px 0; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head .kicker { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); font-weight: 700; margin-bottom: 10px; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--ink-500); }

.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.role-card {
  background: #fff; border: 1px solid var(--paper-200); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease;
}
.role-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.role-card .icon {
  width: 46px; height: 46px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-950); color: var(--gold-300); margin-bottom: 16px; font-size: 20px;
}
.role-card h3 { font-size: 17px; margin-bottom: 8px; }
.role-card p { font-size: 13.5px; color: var(--ink-500); margin: 0 0 14px; }

/* Timeline / signature stepper (used on landing + case tracking) */
.stepper { display: flex; gap: 0; }
.step {
  flex: 1; position: relative; padding: 0 18px 0 0;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; left: calc(38px);
  right: 0; height: 2px; background: var(--paper-200);
}
.step .step-num {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy-950); color: var(--gold-300);
  font-family: var(--font-mono); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; position: relative; z-index: 1; font-size: 14px;
}
.step h4 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--ink-500); margin: 0; }

footer.site-footer {
  background: var(--navy-950); color: #b9c3d4; padding: 36px 0; margin-top: 40px;
  font-size: 13px; border-top: 3px solid var(--gold-500);
}
footer.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer.site-footer a { color: #cfd8e6; }

/* ---------------------------------------------------------------
   Auth / login pages
   --------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--paper-100);
}
.auth-visual {
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 110px);
}
.auth-visual .quote { font-family: var(--font-display); font-size: 22px; max-width: 420px; position: relative; z-index: 1; }
.auth-visual .quote span { color: var(--gold-300); }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 25px; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-500); font-size: 14px; margin-bottom: 30px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--paper-200);
  border-radius: var(--radius-md); font-size: 14.5px; font-family: var(--font-body);
  background: #fff; color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(184,134,59,0.15); outline: none;
}
.field .hint { font-size: 12px; color: var(--ink-300); margin-top: 5px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.demo-login-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 22px; }
.demo-chip {
  border: 1px dashed var(--paper-200); background: #fff; border-radius: var(--radius-md);
  padding: 9px 4px; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--navy-700);
  cursor: pointer; transition: all .12s ease;
}
.demo-chip:hover { border-color: var(--gold-500); background: var(--gold-100); color: var(--navy-950); }

.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-300); font-size: 12px; margin: 22px 0 14px; text-transform: uppercase; letter-spacing: .06em; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--paper-200); }

/* ---------------------------------------------------------------
   App shell (post-login: sidebar + topbar)
   --------------------------------------------------------------- */
.app-shell { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.app-sidebar {
  background: var(--navy-950); color: #d9deea; padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 3px solid var(--gold-500);
}
.app-sidebar .brand { padding: 6px 8px 22px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 18px; }
.side-role-tag {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-300);
  background: rgba(184,134,59,0.15); border: 1px solid rgba(184,134,59,0.35);
  padding: 4px 10px; border-radius: 999px; display: inline-block; margin: 10px 8px 4px;
}
.nav-group { margin-bottom: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-md);
  color: #c4cbdb; font-size: 14px; font-weight: 500; margin-bottom: 2px; transition: background .12s ease, color .12s ease;
}
.nav-link .ic { width: 18px; text-align: center; opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active { background: var(--gold-500); color: var(--navy-950); font-weight: 700; }
.nav-link.active .ic { opacity: 1; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 14px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-md); background: rgba(255,255,255,0.04); }
.user-chip .av { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-500); color: var(--navy-950); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.user-chip .name { font-size: 13px; font-weight: 600; color: #fff; }
.user-chip .role { font-size: 11px; color: #9aa5bb; }

.app-main { background: var(--paper-100); min-height: 100vh; }
.app-topbar {
  background: #fff; border-bottom: 1px solid var(--paper-200); padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.app-topbar h1 { font-size: 20px; margin: 0; }
.app-topbar .breadcrumb { font-size: 12.5px; color: var(--ink-300); margin-top: 2px; }
.app-content { padding: 28px; max-width: 1280px; }

/* ---------------------------------------------------------------
   Cards, tables, stats — shared dashboard components
   --------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: #fff; border: 1px solid var(--paper-200); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-card);
}
.stat-card .label { font-size: 12.5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; color: var(--navy-950); }
.stat-card .delta { font-size: 12px; color: var(--teal-600); margin-top: 6px; }
.stat-card .delta.down { color: var(--red-600); }

.card { background: #fff; border: 1px solid var(--paper-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--paper-200); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 16px; margin: 0; }
.card-body { padding: 22px; }
.card + .card { margin-top: 22px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500);
  padding: 12px 16px; border-bottom: 1px solid var(--paper-200); background: var(--paper-50);
}
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--paper-100); color: var(--ink-700); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--paper-50); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; }
.badge-grey { background: var(--grey-100); color: var(--grey-600); }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }
.badge-amber { background: var(--amber-100); color: var(--amber-600); }
.badge-teal { background: var(--teal-100); color: var(--teal-700); }
.badge-purple { background: var(--purple-100); color: var(--purple-600); }
.badge-green { background: var(--teal-100); color: var(--teal-700); }
.badge-red { background: var(--red-100); color: var(--red-700); }

.alert { padding: 13px 16px; border-radius: var(--radius-md); font-size: 13.8px; margin-bottom: 16px; border: 1px solid transparent; display:flex; gap:10px; align-items:flex-start;}
.alert-success { background: var(--teal-100); color: var(--teal-700); border-color: rgba(31,122,108,0.25); }
.alert-error { background: var(--red-100); color: var(--red-700); border-color: rgba(178,58,58,0.25); }
.alert-info { background: var(--blue-100); color: var(--blue-600); border-color: rgba(42,77,127,0.25); }
.alert-warn { background: var(--amber-100); color: var(--amber-600); border-color: rgba(163,103,28,0.25); }

.pill-toggle { display: inline-flex; border: 1px solid var(--paper-200); border-radius: 999px; overflow: hidden; }
.pill-toggle button { border: none; background: #fff; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-500); }
.pill-toggle button.active { background: var(--navy-950); color: #fff; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--grey-100); border-radius: 999px; transition: .15s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch input:checked + .slider { background: var(--teal-600); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.progress-track { height: 6px; border-radius: 999px; background: var(--paper-200); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); border-radius: 999px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state .ic { font-size: 34px; margin-bottom: 12px; }

/* Vertical case-ledger tracker (signature element) */
.ledger { position: relative; padding-left: 4px; }
.ledger-item { position: relative; padding: 0 0 30px 40px; }
.ledger-item::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--paper-200);
}
.ledger-item:last-child::before { display: none; }
.ledger-item .dot {
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--paper-200); color: var(--ink-500); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 3px solid var(--paper-100);
}
.ledger-item.done .dot { background: var(--teal-600); color: #fff; }
.ledger-item.current .dot { background: var(--gold-500); color: var(--navy-950); }
.ledger-item h4 { font-size: 14.5px; margin: 0 0 3px; }
.ledger-item .meta { font-size: 12.5px; color: var(--ink-500); }
.ledger-item .ts { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-300); margin-top: 3px; }

/* Razorpay dummy checkout modal look */
.rzp-modal-backdrop { position: fixed; inset: 0; background: rgba(11,27,51,0.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.rzp-modal { width: 400px; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-pop); }
.rzp-head { background: #072654; color: #fff; padding: 18px 22px; display: flex; align-items: center; gap: 12px; }
.rzp-head .logo { width: 32px; height: 32px; border-radius: 8px; background: #fff; color: #072654; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.rzp-body { padding: 22px; }
.rzp-amount { font-family: var(--font-display); font-size: 26px; margin-bottom: 4px; }
.rzp-methods { display: flex; gap: 8px; margin: 16px 0; }
.rzp-methods button { flex: 1; padding: 9px; border-radius: 8px; border: 1px solid var(--paper-200); background: var(--paper-50); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.rzp-methods button.active { border-color: #072654; background: #eef3fb; color: #072654; }
.test-mode-tag { background: var(--amber-100); color: var(--amber-600); font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 700; margin-left: auto; }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-0{margin-top:0} .mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px}
.mb-0{margin-bottom:0} .mb-8{margin-bottom:8px} .mb-16{margin-bottom:16px} .mb-24{margin-bottom:24px}
.text-muted { color: var(--ink-500); }
.text-sm { font-size: 13px; }
.w-full { width: 100%; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 980px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 258px; transform: translateX(-100%); transition: transform .2s ease; z-index: 40; }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .sidebar-backdrop.open { display: block; }
  .menu-toggle { display: inline-flex !important; }
}
@media (min-width: 981px) { .menu-toggle { display: none !important; } }

@media (max-width: 640px) {
  .role-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
  .demo-login-row { grid-template-columns: repeat(3, 1fr); }
  .field-row { flex-direction: column; gap: 0; }
  .stepper { flex-direction: column; gap: 18px; }
  .step:not(:last-child)::after { display: none; }
  .app-content { padding: 18px; }
  .app-topbar { padding: 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
