/*
 * Utsanzi Pay — styled after the Utsanzi client portal (utsanzi-subscriptions):
 *  - public site, legal pages and checkout follow its public site
 *    (Avenir Next, slate background, floating nav island, black buttons, navy bands);
 *  - the admin follows its admin (Inter, dark sidebar, white cards, pill badges).
 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black: #000; --white: #fff;
  --blue: #1e3a8a; --blue-l: #2563eb; --blue-a: #3b82f6;
  --g900: #111827; --g800: #1f2937; --g700: #374151; --g600: #4b5563; --g500: #6b7280;
  --g400: #9ca3af; --g300: #d1d5db; --g200: #e5e7eb; --g100: #f3f4f6; --g50: #f9fafb;
  --green: #16a34a; --red: #dc2626; --yellow: #d97706;
  --font: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-app: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 12px; --rl: 20px;
  /* names used across the views */
  --text: var(--g900); --muted: var(--g500); --border: var(--g200); --surface: var(--white); --surface-2: var(--g100);
  --accent: var(--blue); --paid: #166534; --failed: #991b1b; --pending: #92400e; --info: #1e40af;
}

body { font-family: var(--font); color: var(--g900); background: var(--g100); line-height: 1.55; font-size: 15px; }
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--g900); letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.45rem; font-weight: 800; margin-bottom: .25rem; }
h2 { font-size: .975rem; font-weight: 700; margin-bottom: .85rem; }
h3 { font-size: .95rem; font-weight: 700; margin-bottom: .35rem; }
p { margin-bottom: 0; }
.muted { color: var(--g500); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .82rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.card { background: var(--white); border: 1px solid var(--g200); border-radius: var(--rl); padding: 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--r); font-family: inherit;
  font-size: .845rem; font-weight: 600; cursor: pointer; border: 1px solid var(--g200); background: var(--g100); color: var(--g800); text-decoration: none; transition: all .15s; white-space: nowrap; }
.btn:hover { background: var(--g200); text-decoration: none; }
.btn-primary { background: var(--black); border-color: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); }
.btn-danger { background: #fee2e2; border-color: #fee2e2; color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-block { width: 100%; padding: 12px; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; border-radius: 8px; }
.btn-outline { background: transparent; color: var(--black); border: 2px solid var(--g300); }
.btn-outline:hover { background: transparent; border-color: var(--black); }

label { display: block; font-size: .78rem; font-weight: 600; color: var(--g700); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 8px 11px; border: 1.5px solid var(--g300); border-radius: var(--r); font-family: inherit; font-size: .9rem; color: var(--g900); background: var(--white); outline: none; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--black); }
input:focus, select:focus, textarea:focus { border-color: var(--blue-a); box-shadow: 0 0 0 3px rgba(59,130,246,.10); }
textarea { resize: vertical; }
.field + .field { margin-top: 16px; }
.hint { font-size: .74rem; color: var(--g500); margin-top: 3px; }
.error { font-size: .78rem; color: var(--red); margin-top: 3px; }
.alert { padding: 11px 14px; border-radius: var(--r); font-size: .86rem; font-weight: 500; background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--g200); color: var(--g700); white-space: nowrap; text-transform: capitalize; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-failed, .badge-cancelled, .badge-expired, .badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-pending, .badge-processing, .badge-open { background: #fef3c7; color: #92400e; }
.badge-test { background: #dbeafe; color: #1e40af; }

table { width: 100%; border-collapse: collapse; }
th { font-size: .72rem; font-weight: 600; color: var(--g500); text-transform: uppercase; letter-spacing: .05em; padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--g200); white-space: nowrap; }
td { padding: 11px; font-size: .86rem; color: var(--g800); border-bottom: 1px solid var(--g100); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--g50); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.stat .label { font-size: .72rem; font-weight: 600; color: var(--g500); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.9rem; font-weight: 800; color: var(--g900); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
dl.facts dt { font-size: .8rem; font-weight: 600; color: var(--g500); }
dl.facts dd { font-size: .86rem; color: var(--g900); word-break: break-word; }
pre { background: var(--g100); padding: .6rem; border-radius: 8px; overflow-x: auto; font-size: .76rem; margin-top: .4rem; }
details summary { cursor: pointer; color: var(--g500); font-size: .85rem; }
.timeline { list-style: none; }
.timeline li { padding: .6rem 0; border-bottom: 1px dashed var(--g200); }

/* logo + name, as in the portal nav */
.brand { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.35rem; font-weight: 700; color: var(--black); letter-spacing: -.02em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; }
.brand .pay { font-weight: 500; color: var(--g500); }

/* ── Admin: the portal's admin shell ───────────────────────────────── */
body.app { font-family: var(--font-app); display: flex; min-height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; width: 240px; height: 100vh; background: var(--g900); display: flex; flex-direction: column; z-index: 200; }
.sb-brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.07); display: flex; align-items: center; gap: 10px; }
.sb-brand img { height: 26px; filter: invert(1); }
.sb-brand .name { font-size: .85rem; font-weight: 700; color: var(--white); }
.sb-brand .tag { font-size: .62rem; color: var(--blue-a); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px; }
.sb-nav a { display: block; padding: 8px 10px; border-radius: 9px; font-size: .845rem; font-weight: 500; color: var(--g400); margin-bottom: 1px; text-decoration: none; }
.sb-nav a:hover { background: rgba(255,255,255,.06); color: var(--white); }
.sb-nav a.active { background: rgba(59,130,246,.18); color: var(--blue-a); }
.sb-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.05); }
.sb-user .av { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-a) 100%); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--white); flex-shrink: 0; }
.sb-user .who { flex: 1; min-width: 0; font-size: .78rem; font-weight: 600; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user button { background: none; border: none; color: var(--g500); cursor: pointer; font: inherit; font-size: .74rem; }
.sb-user button:hover { color: var(--red); }
.admin-main { margin-left: 240px; flex: 1; padding: 24px; min-width: 0; max-width: 1400px; }
.mob-bar { display: none; }
@media (max-width: 1024px) {
  body.app { display: block; }
  .sidebar { position: static; width: auto; height: auto; }
  .sb-nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .sb-foot { display: none; }
  .admin-main { margin-left: 0; padding: 16px; }
}
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 16px; }

/* ── Public pages (site, legal, checkout): the portal's public look ── */
body.public { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); min-height: 100vh; overflow-x: hidden; }
body.public::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle at 25% 25%, rgba(30,58,138,.08) 0%, transparent 50%), radial-gradient(circle at 75% 75%, rgba(59,130,246,.08) 0%, transparent 50%); }
.spiral-container { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.spiral-line { position: absolute; width: 2px; height: 150%; transform-origin: center bottom; animation: spiral-rotate 20s linear infinite;
  background: linear-gradient(to bottom, transparent 0%, rgba(30,58,138,.05) 25%, rgba(59,130,246,.10) 50%, rgba(30,58,138,.05) 75%, transparent 100%); }
.spiral-line:nth-child(1) { left: 10%; animation-duration: 25s; }
.spiral-line:nth-child(2) { left: 30%; animation-delay: -8s; animation-duration: 30s; }
.spiral-line:nth-child(3) { left: 55%; animation-delay: -15s; animation-duration: 28s; }
.spiral-line:nth-child(4) { left: 80%; animation-delay: -22s; animation-duration: 32s; }
@keyframes spiral-rotate { 0% { transform: rotate(0) translateY(0); opacity: 0; } 10%, 90% { opacity: 1; } 100% { transform: rotate(360deg) translateY(-100px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .spiral-line { animation: none; opacity: .6; } }
body.public main, body.public footer { position: relative; z-index: 10; }

.nav-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; width: 100%; max-width: 1200px; padding: 0 20px; }
.nav-island { background: rgba(255,255,255,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.2);
  border-radius: 50px; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; box-shadow: 0 8px 32px rgba(0,0,0,.1); }
.nav-menu { display: flex; list-style: none; gap: 2rem; align-items: center; }
.nav-menu a { color: var(--g800); font-weight: 500; font-size: .95rem; }
.nav-menu a:hover { color: var(--black); text-decoration: none; }
.nav-cta { background: var(--black); color: var(--white); padding: .6rem 1.4rem; border-radius: 50px; font-weight: 600; font-size: .9rem; }
.nav-cta:hover { background: var(--blue); text-decoration: none; }
@media (max-width: 760px) { .nav-menu { display: none; } .nav-island { padding: 10px 14px 10px 18px; } .brand { font-size: 1.15rem; } .brand img { height: 28px; } }

.hero { min-height: 82vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 140px 20px 60px; }
.hero-inner { max-width: 820px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; color: var(--black); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 1.5rem; }
.hero p { font-size: 1.2rem; color: var(--g600); line-height: 1.6; margin: 0 auto 2.5rem; max-width: 640px; }
.hero .ctas { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.hero .accepted { margin-top: 2.5rem; font-size: .9rem; color: var(--g600); }
.hero .accepted strong { color: var(--black); }

.section-dark { padding: 90px 5%; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.section-light { padding: 90px 5%; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; margin-bottom: .75rem; }
.section-title p { font-size: 1.1rem; color: var(--g600); }
.section-dark .section-title h2 { color: var(--white); }
.section-dark .section-title p { color: rgba(255,255,255,.7); }
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1.5rem; }
.card-dark { background: rgba(255,255,255,.06); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; padding: 2.25rem; }
.card-dark h3 { color: var(--white); font-size: 1.25rem; margin-bottom: .6rem; }
.card-dark p { color: rgba(255,255,255,.7); line-height: 1.65; }
.card-light { background: var(--white); border: 1px solid rgba(0,0,0,.06); border-radius: 20px; padding: 2.5rem; }
.price-card { max-width: 620px; margin: 0 auto; text-align: center; }
.price-card .figure { font-size: 3rem; font-weight: 800; color: var(--black); letter-spacing: -.03em; }
.price-card .figure small { font-size: 1.05rem; font-weight: 600; color: var(--g500); letter-spacing: 0; }
.price-card p { color: var(--g600); margin: .75rem auto 1.75rem; max-width: 30rem; line-height: 1.6; }

.footer { background: var(--g100); border-top: 1px solid rgba(0,0,0,.1); }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 20px 5%; }
.footer-columns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; padding: 40px 0; border-bottom: 1px solid rgba(0,0,0,.1); }
.footer-col h4 { font-size: .75rem; font-weight: 600; color: var(--g800); margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .6rem; }
.footer-col a, .footer-col span { font-size: .75rem; color: var(--g600); }
.footer-col a:hover { color: var(--black); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p, .footer-bottom span { font-size: .75rem; color: var(--g600); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: .75rem; color: var(--g600); border-right: 1px solid var(--g400); padding-right: 1.5rem; }
.footer-links a:last-child { border-right: none; padding-right: 0; }
@media (max-width: 760px) { .footer-columns { grid-template-columns: 1fr 1fr; } }

/* legal pages — the portal's legal layout */
.legal-hero { padding: 160px 5% 50px; text-align: center; }
.legal-hero-inner { max-width: 800px; margin: 0 auto; }
.legal-badge { display: inline-block; background: var(--black); color: var(--white); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 16px; border-radius: 50px; margin-bottom: 1.5rem; }
.legal-hero-inner h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--black); line-height: 1.15; margin-bottom: 1rem; }
.legal-hero-inner > p { font-size: 1.1rem; color: var(--g600); line-height: 1.6; margin-bottom: 2rem; }
.legal-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.legal-meta-item { background: rgba(255,255,255,.7); backdrop-filter: blur(10px); border: 1px solid rgba(0,0,0,.08); border-radius: 14px; padding: 10px 20px; text-align: left; min-width: 150px; }
.legal-meta-label { display: block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--g400); margin-bottom: 2px; }
.legal-meta-value { display: block; font-size: .9rem; font-weight: 600; color: var(--black); }
.legal-body { padding: 20px 5% 100px; }
.legal-layout { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 260px 1fr; gap: 3rem; align-items: start; }
.legal-sidebar { position: sticky; top: 120px; background: rgba(255,255,255,.7); backdrop-filter: blur(10px); border: 1px solid rgba(0,0,0,.08); border-radius: 20px; padding: 1.5rem; }
.legal-sidebar-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--g400); margin-bottom: 1rem; }
.legal-sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.legal-sidebar-nav a { display: block; font-size: .85rem; color: var(--g600); padding: 8px 10px; border-radius: 10px; line-height: 1.4; }
.legal-sidebar-nav a:hover { background: var(--g100); color: var(--black); text-decoration: none; }
.legal-content { background: rgba(255,255,255,.7); backdrop-filter: blur(10px); border: 1px solid rgba(0,0,0,.08); border-radius: 25px; padding: 3rem; min-width: 0; }
.legal-highlight { background: rgba(30,58,138,.06); border-left: 4px solid var(--blue); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 2.5rem; }
.legal-highlight p { color: var(--g800); font-size: .95rem; line-height: 1.6; }
.legal-section { scroll-margin-top: 120px; padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid rgba(0,0,0,.08); }
.legal-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.legal-section h2 { font-size: 1.5rem; font-weight: 700; color: var(--black); margin-bottom: 1rem; }
.legal-section h3 { font-size: 1.1rem; font-weight: 600; color: var(--black); margin: 1.5rem 0 .75rem; }
.legal-section p { font-size: .95rem; line-height: 1.7; color: var(--g700); margin-bottom: 1rem; }
.legal-section ul, .legal-section ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal-section li { font-size: .95rem; line-height: 1.7; color: var(--g700); margin-bottom: .5rem; }
.legal-section a { text-decoration: underline; }
.legal-contact-box { background: var(--g100); border-radius: 16px; padding: 1.5rem 1.75rem; margin-top: 1rem; }
.legal-contact-box p { margin-bottom: .4rem; }
@media (max-width: 900px) { .legal-layout { grid-template-columns: 1fr; } .legal-sidebar { position: static; } .legal-content { padding: 1.75rem; } .legal-hero { padding-top: 130px; } }

/* checkout — a white card on the portal's background */
.checkout-top { max-width: 480px; margin: 0 auto; padding: 32px 16px 0; text-align: center; position: relative; z-index: 10; }
.checkout { max-width: 480px; margin: 0 auto; padding: 18px 16px 48px; position: relative; z-index: 10; }
.checkout > .card, .checkout .card { border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,.06); }
.checkout .amount { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; color: var(--black); font-variant-numeric: tabular-nums; }
.option { display: flex; gap: .75rem; align-items: center; border: 1.5px solid var(--g200); border-radius: var(--r); padding: .85rem 1rem; cursor: pointer; font-size: .95rem; font-weight: 500; color: var(--g900); background: var(--white); margin: 0; transition: border-color .15s, background .15s; }
.option + .option { margin-top: .5rem; }
.option:has(input:checked) { border-color: var(--black); background: var(--g50); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--g200); border-top-color: var(--black); border-radius: 50%; animation: spin 1s linear infinite; margin: 1rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.secure { text-align: center; color: var(--g500); font-size: .78rem; margin-top: 1.25rem; }
.secure a { color: var(--g500); text-decoration: underline; }
