:root,
html[data-theme="dark"] {
  --bg: #0b1420;
  --bg-2: #172231;
  --panel: rgba(20, 30, 44, 0.72);
  --panel-strong: rgba(22, 34, 49, 0.84);
  --panel-border: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #e7edf5;
  --muted: #a2afbf;
  --muted-2: #7f8ea2;
  --accent: #d7ad61;
  --accent-2: #bc8d42;
  --success: #35bf79;
  --danger: #d97171;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1160px;
}

html[data-theme="light"] {
  --bg: #eef3f8;
  --bg-2: #dde6f0;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(10, 20, 35, 0.1);
  --line-soft: rgba(10, 20, 35, 0.08);
  --text: #132235;
  --muted: #556577;
  --muted-2: #66788c;
  --accent: #c9922f;
  --accent-2: #b07a20;
  --success: #219653;
  --danger: #c85f5f;
  --shadow: 0 24px 70px rgba(35, 52, 74, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 170, 87, 0.07), transparent 26%),
    radial-gradient(circle at top right, rgba(92, 122, 168, 0.09), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  transition: background 0.25s ease, color 0.25s ease;
}

body {
  padding: 28px 18px 44px;
}

.app-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.22;
}

.bg-orb-a {
  width: 280px;
  height: 280px;
  background: rgba(216, 170, 87, 0.35);
  top: -60px;
  left: -40px;
  animation: floatA 14s ease-in-out infinite;
}

.bg-orb-b {
  width: 340px;
  height: 340px;
  background: rgba(82, 116, 169, 0.22);
  right: -80px;
  top: 180px;
  animation: floatB 16s ease-in-out infinite;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.42), transparent 85%);
}

html[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(10, 20, 35, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 20, 35, 0.035) 1px, transparent 1px);
}

@keyframes floatA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(22px, 18px, 0); }
}

@keyframes floatB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-18px, 24px, 0); }
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
}

.top-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.lang-switcher,
.theme-switcher {
  display: flex;
  gap: 10px;
}

.lang-btn,
.theme-btn {
  appearance: none;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.flag {
  font-size: 15px;
  line-height: 1;
}

.lang-btn:hover,
.theme-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 170, 87, 0.25);
}

.lang-btn.active,
.theme-btn.active {
  background: rgba(216, 170, 87, 0.12);
  border-color: rgba(216, 170, 87, 0.34);
  color: var(--text);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
    var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

html[data-theme="light"] .hero {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.65)),
    rgba(255, 255, 255, 0.86);
}

.hero-enterprise::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(216, 170, 87, 0.12), transparent 28%),
    linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.02) 100%);
  pointer-events: none;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-badge,
.hero-status,
.panel-kicker,
.info-label,
.invoice-label,
.pot-label,
.eyebrow,
.summary-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-badge {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
}

.hero-status {
  padding: 8px 12px;
  border-radius: 999px;
  color: #b8e8c8;
  border: 1px solid rgba(47, 191, 113, 0.2);
  background: rgba(47, 191, 113, 0.1);
}

.hero-content {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero-subtitle {
  margin: 18px 0 0;
  max-width: 720px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.summary-kicker {
  color: var(--muted);
}

.summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 16px rgba(47, 191, 113, 0.6);
}

.hero-summary-card {
  position: relative;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025)),
    rgba(15, 22, 34, 0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

html[data-theme="light"] .hero-summary-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.72)),
    rgba(255, 255, 255, 0.9);
}

.summary-metrics {
  display: grid;
  gap: 14px;
}

.summary-metric {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line-soft);
}

.summary-metric span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-metric strong {
  font-size: 22px;
  font-weight: 700;
}

.summary-note {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.main-grid {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-card,
.panel,
.stat-card,
.pot-side-card,
.legal-card {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.info-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 170, 87, 0.22);
}

.info-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.info-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.info-label,
.panel-kicker,
.invoice-label,
.pot-label {
  color: var(--muted-2);
}

.panel {
  padding: 28px;
  border-radius: var(--radius-xl);
}

.panel-header h2,
.panel-header h3 {
  margin: 8px 0 10px;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.03em;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.single-field-grid {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  color: var(--text);
}

.field-full {
  grid-column: 1 / -1;
}

input {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  border-color: rgba(216, 170, 87, 0.45);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 4px rgba(216, 170, 87, 0.08);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

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

.btn-primary {
  color: #111;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 32px rgba(185, 138, 61, 0.22);
}

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

.btn-large {
  min-width: 230px;
}

.auth-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.btn-logout {
  white-space: nowrap;
}

.pot-hero {
  margin-top: 24px;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(216, 170, 87, 0.16);
  background:
    linear-gradient(135deg, rgba(216, 170, 87, 0.08), rgba(255,255,255,0.02)),
    rgba(14, 22, 36, 0.9);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .pot-hero {
  background:
    linear-gradient(135deg, rgba(216, 170, 87, 0.1), rgba(255,255,255,0.55)),
    rgba(255, 255, 255, 0.9);
}

.enterprise-pot {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: stretch;
}

.pot-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pot-hero strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(36px, 7vw, 58px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.pot-hero small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.pot-hero-side {
  display: grid;
  gap: 12px;
}

.pot-side-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}

.pot-side-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.pot-side-card strong {
  font-size: 18px;
  line-height: 1.35;
}

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

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
}

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

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

.cta-box,
.payment-card {
  margin-top: 22px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-strong);
  padding: 24px;
  box-shadow: var(--shadow);
}

.cta-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.cta-box h3,
.payment-card h3 {
  margin: 8px 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.cta-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.status-badge {
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-idle {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.06);
}

.status-pending {
  background: rgba(216, 170, 87, 0.12);
  color: #f3d39c;
  border-color: rgba(216, 170, 87, 0.18);
}

.status-paid {
  background: rgba(47, 191, 113, 0.12);
  color: #aee5c1;
  border-color: rgba(47, 191, 113, 0.2);
}

.status-error {
  background: rgba(217, 107, 107, 0.12);
  color: #f3bbbb;
  border-color: rgba(217, 107, 107, 0.18);
}

.paid-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(47, 191, 113, 0.12);
  border: 1px solid rgba(47, 191, 113, 0.18);
  color: #c6f0d5;
  font-weight: 600;
}

.qr-wrap {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px dashed rgba(255,255,255,0.08);
  position: relative;
}

.qr-wrap::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.03);
  pointer-events: none;
}

canvas {
  display: block;
  max-width: 100%;
  position: relative;
  z-index: 1;
}

.invoice-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 28, 40, 0.58);
  border: 1px solid rgba(255,255,255,0.05);
}

html[data-theme="light"] .invoice-box {
  background: rgba(245, 248, 252, 0.85);
}

small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  word-break: break-all;
  font-size: 12px;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  margin-top: 28px;
  padding: 22px 0 6px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 22px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.footer-brand strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
}

.footer-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a,
.legal-back {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.18s ease;
}

.footer-links a:hover,
.legal-back:hover {
  opacity: 0.78;
}

/* Legal pages */
.legal-shell {
  max-width: 900px;
}

.legal-card {
  padding: 32px;
  border-radius: 28px;
}

.legal-card h1 {
  margin: 16px 0 8px;
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -0.04em;
}

.legal-date {
  margin: 0 0 24px;
  color: var(--muted);
}

.legal-section + .legal-section {
  margin-top: 22px;
}

.legal-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.legal-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.legal-back {
  display: inline-block;
  margin-bottom: 4px;
}

@media (max-width: 980px) {
  .hero-content,
  .enterprise-pot,
  .info-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .cta-box,
  .app-topbar,
  .payment-header,
  .hero-topline,
  .hero-actions,
  .top-controls,
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .lang-switcher,
  .theme-switcher,
  .footer-links {
    justify-content: stretch;
  }

  .lang-btn,
  .theme-btn {
    flex: 1;
    justify-content: center;
  }

  .btn-large,
  .btn-logout {
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    padding: 18px 14px 34px;
  }

  .hero,
  .panel,
  .cta-box,
  .payment-card,
  .legal-card {
    padding: 20px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .qr-wrap {
    min-height: 240px;
  }
}
