:root {
  --nav: #263238;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: rgba(38, 50, 56, 0.14);

  --text: #0f172a;
  --muted: #54616c;

  /* TPPay accent */
  --magenta: #a21caf;
  --pink: #d946ef;
  --orange: #f97316;

  --shadow-md: 0 18px 48px rgba(2, 6, 23, .10);
  --shadow-sm: 0 8px 20px rgba(2, 6, 23, .08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
}

.page {
  min-height: 100vh; /* fallback */
  min-height: 100dvh; /* dynamic viewport */
  display: flex;
  flex-direction: column;
}

@supports not (height: 100dvh) and (-webkit-touch-callout: none) {
  html, body { min-height: -webkit-fill-available; }
  .page { min-height: -webkit-fill-available; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.topnav {
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
    var(--nav);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand img {
  height: 28px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.35));
}

.brand-title {
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.1;
  font-size: 14px;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,.72);
  margin-top: 2px;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.userpill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 12px;
  color: rgba(255,255,255,.92);
  max-width: min(520px, 70vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 16px 24px 34px;
}

.main.full {
  width: 100%;
  max-width: none;
  padding: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* iframe manages its own scroll */
}

.main.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.embed-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 18px;
}

h1 {
  margin: 0 0 12px;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-size: 34px;
  letter-spacing: -0.6px;
}

h2 {
  margin: 0 0 10px;
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  letter-spacing: -0.3px;
}

p { margin: 0 0 12px; color: var(--muted); line-height: 1.7; }
.muted { color: var(--muted); }

input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

input:focus {
  outline: none;
  border-color: rgba(249, 115, 22, .55);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .14);
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease, background-color .15s ease;
  user-select: none;
  white-space: nowrap;
  font: inherit;
}

button.btn {
  cursor: pointer;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--magenta), var(--orange));
  box-shadow: var(--shadow-sm);
  border: 0;
}

.btn.ghost {
  color: var(--text);
  background: rgba(255,255,255,.88);
  border: 1px solid var(--border);
}

.btn.nav {
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}

.btn.block {
  width: 100%;
}

.btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.btn.disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
  transform: none;
}

/* Auth shell (OTP/login/protected) */
.auth-shell {
  width: min(980px, 100%);
  animation: fadeUp .55s ease both;
}

.auth-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.hero-diagonal {
  height: 10px;
  background: linear-gradient(90deg, var(--magenta), var(--orange));
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(2,6,23,.03), rgba(2,6,23,0));
}

.auth-kicker {
  font-family: "Montserrat", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.2px;
  font-size: 14px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(2, 6, 23, .12);
  background: rgba(249, 115, 22, .08);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.auth-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--magenta), var(--orange));
}

.auth-content {
  padding: 24px;
}

.split {
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: 26px;
  align-items: stretch;
}

.note {
  display: flex;
  gap: 12px;
  background: rgba(2, 6, 23, .02);
  border: 1px solid rgba(2, 6, 23, .12);
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}

.otp-input {
  width: min(340px, 100%);
  display: block;
  margin: 6px auto 0;
  text-align: center;
  letter-spacing: 10px;
  font-size: 22px;
  font-weight: 800;
  padding: 14px 16px;
  border-radius: 16px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(2, 6, 23, .02), rgba(2, 6, 23, 0));
}

.auth-card .panel {
  background: rgba(2, 6, 23, .02);
  border: 1px solid rgba(2, 6, 23, .10);
  box-shadow: none;
}

@media (max-width: 900px) {
  .brand { min-width: 0; }
  .brand-title { font-size: 13px; }
  h1 { font-size: 28px; }
  .split { grid-template-columns: 1fr; }
  .hero-diagonal {
    height: 8px;
  }
}

.main {
  padding-top: 20px;
  padding-inline: 18px;
}

.main:not(.full) {
  background:
    radial-gradient(900px 380px at 20% 0%, rgba(217,70,239,.08), rgba(217,70,239,0) 60%),
    radial-gradient(900px 380px at 80% 0%, rgba(249,115,22,.08), rgba(249,115,22,0) 60%);
}
