:root {
  color-scheme: light;
  --brand-blue: #2563eb;
  --brand-teal: #14b8a6;
  --brand-ink: #0f172a;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --hero-glow: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.18), transparent 70%);
}

html.dark {
  --surface-glass: rgba(17, 24, 39, 0.88);
  --hero-glow: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(20, 184, 166, 0.14), transparent 70%);
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body.app-body {
  background-color: #f8fafc;
  background-image: var(--hero-glow);
  background-attachment: fixed;
}

html.dark body.app-body {
  background-color: #0b1220;
}

.app-main {
  width: 100%;
  max-width: 48rem;
}

.app-main--wide {
  max-width: 68rem;
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.brand-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}

@media (min-width: 768px) {
  .brand-title {
    white-space: nowrap;
  }
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.55);
}

#support-panel:not(.hidden) {
  display: block;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #0ea5e9 100%);
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -12px rgba(37, 99, 235, 0.65);
  filter: brightness(1.03);
}

.btn-secondary {
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 20px 40px -24px rgba(15, 23, 42, 0.18);
}

html.dark .glass-panel {
  border-color: rgba(100, 116, 139, 0.35);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 24px 48px -28px rgba(0, 0, 0, 0.55);
}

.metric-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-start, #2563eb), var(--accent-end, #14b8a6));
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -20px rgba(15, 23, 42, 0.35);
}

.metric-card--open {
  --accent-start: #2563eb;
  --accent-end: #38bdf8;
}

.metric-card--overdue {
  --accent-start: #ef4444;
  --accent-end: #f97316;
}

.metric-card--paid {
  --accent-start: #16a34a;
  --accent-end: #14b8a6;
}

.metric-card--total {
  --accent-start: #64748b;
  --accent-end: #94a3b8;
}

.dashboard-primary-cta {
  box-shadow: 0 12px 28px -12px rgba(13, 148, 136, 0.55);
}

.record-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

html.dark .record-card {
  border-color: rgba(71, 85, 105, 0.85);
  background: rgba(17, 24, 39, 0.92);
}

.record-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 14px 28px -22px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

html.dark .app-header {
  background: rgba(15, 23, 42, 0.9);
}

.landing-hero-primary-cta {
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, 0.55);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

html.dark .form-label {
  color: #e2e8f0;
}

.form-input {
  margin-top: 0.25rem;
  width: 100%;
  min-height: 44px;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

html.dark .form-input {
  border-color: #475569;
  background: #0f172a;
  color: #f8fafc;
}

textarea.form-input {
  min-height: 132px;
  resize: vertical;
}

.trust-page {
  max-width: 42rem;
}

.trust-page-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d9488;
}

.trust-page-title {
  margin-top: 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

html.dark .trust-page-title {
  color: #f8fafc;
}

.trust-page-body {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.65;
  color: #475569;
}

html.dark .trust-page-body {
  color: #cbd5e1;
}

.trust-page-back {
  margin-top: 1.5rem;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
}

html.dark .trust-page-back {
  color: #93c5fd;
}

.trust-page-back:hover {
  color: #1d4ed8;
}

.app-footer {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

html.dark .app-footer {
  background: rgba(15, 23, 42, 0.88);
}

.app-footer-inner {
  max-width: 68rem;
}

.error-page {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.error-page-code {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.error-page-title {
  margin-top: 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

html.dark .error-page-title {
  color: #f8fafc;
}

.error-page-body {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #64748b;
}

html.dark .error-page-body {
  color: #cbd5e1;
}

.error-page-code--info {
  color: #2563eb;
}

.error-page-code--warn {
  color: #d97706;
}

.error-page-code--danger {
  color: #dc2626;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .metric-card,
  .record-card {
    transition: none;
  }

  .btn-primary:hover,
  .metric-card:hover,
  .record-card:hover {
    transform: none;
  }
}
