/* Wonderful Lease – Pelle UI */

:root {
  --bg: #f0f9ff;
  --bg-deep: #e0f2fe;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --border: rgba(14, 165, 233, 0.18);
  --border-strong: rgba(3, 105, 161, 0.25);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #38bdf8;
  --accent: #0ea5e9;
  --success: #059669;
  --error: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 24px rgba(14, 116, 144, 0.12);
  --shadow-lg: 0 20px 50px -12px rgba(14, 116, 144, 0.22);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1 0 auto;
}

/* Ambient background */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
      ellipse 80% 50% at 50% -20%,
      rgba(14, 165, 233, 0.22),
      transparent 50%
    ), radial-gradient(ellipse 60% 40% at 100% 50%, rgba(56, 189, 248, 0.12), transparent 45%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(34, 211, 238, 0.1), transparent 40%),
    linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  animation: mesh-shift 18s ease-in-out infinite alternate;
}

@keyframes mesh-shift {
  0% {
    opacity: 1;
    filter: hue-rotate(0deg);
  }
  100% {
    opacity: 0.95;
    filter: hue-rotate(6deg);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.92;
}

.brand__logo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(125, 162, 255, 0.35);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand__logo {
  transform: scale(1.04) rotate(-2deg);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand__tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.main-nav__link {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.main-nav__link:hover {
  color: var(--primary-dark);
  background: rgba(14, 165, 233, 0.1);
}

.main-nav__link--active {
  color: var(--primary-dark);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(56, 189, 248, 0.12));
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.25);
  font-weight: 600;
}

/* Hero */
.hero {
  padding: 2.5rem 1.25rem 1rem;
}

.hero--home .hero__grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero--home .hero__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text);
  background: linear-gradient(120deg, #0f172a 0%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 36ch;
}

.hero__bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.hero__bullets li {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-dark);
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: bullet-in 0.6s ease backwards;
}

.hero__bullets li:nth-child(1) {
  animation-delay: 0.15s;
}
.hero__bullets li:nth-child(2) {
  animation-delay: 0.28s;
}
.hero__bullets li:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bullet-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--surface);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.45s ease;
}

.hero-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 28px 60px -16px rgba(3, 105, 161, 0.28);
}

.hero-card__illustration {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  /* Prevent flex/grid from squashing the viewBox (ovals + “bar” silhouette) */
  aspect-ratio: 400 / 240;
  max-width: 100%;
}

.hero-card__road-lines {
  animation: road-dash 12s linear infinite;
}

@keyframes road-dash {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-40px);
  }
}

.hero-card__car {
  animation: car-bob 4s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes car-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.hero-card__glow--a {
  animation: glow-pulse 5s ease-in-out infinite;
}

.hero-card__glow--b {
  animation: glow-pulse 5s ease-in-out infinite 1.2s;
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.08);
  }
}

.hero-card__badge {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.hero-card__badge-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.hero-card__badge-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Page hero (overview) */
.page-hero {
  padding: 2rem 1.25rem 1.5rem;
  text-align: left;
}

.page-hero--compact .page-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.page-hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.page-hero__lead {
  margin: 0;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.page-overview .page-hero {
  text-align: center;
}

.page-overview .page-hero__lead {
  margin-left: auto;
  margin-right: auto;
}

/* Containers */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.container--narrow {
  max-width: 640px;
}

.container--wide {
  max-width: none;
  width: 100%;
}

.page-overview .container--wide {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.section-form {
  padding-top: 0.5rem;
}

.section-form__intro {
  text-align: center;
  margin-bottom: 1.75rem;
}

.section-form__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.section-form__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.section-table {
  padding-bottom: 3rem;
}

/* Entrance animations */
.animate-in {
  animation: fade-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.animate-in--delay {
  animation-delay: 0.12s;
}

.animate-in--delay-2 {
  animation-delay: 0.22s;
}

.animate-in--delay-3 {
  animation-delay: 0.32s;
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Headings (legacy h1 in main if any) */
h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: var(--text);
}

/* Cards */
.card {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
}

.card--elevated {
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Form */
.form-group {
  margin-bottom: 1.35rem;
}

.form-group:last-of-type {
  margin-bottom: 0;
}

label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

label .required {
  color: var(--error);
}

input[type="text"],
input[type="tel"],
input[type="email"],
select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

input:hover,
select:hover {
  border-color: rgba(3, 105, 161, 0.45);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

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

input[type="file"] {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(240, 249, 255, 0.6);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

input[type="file"]:hover {
  border-color: var(--accent);
  background: rgba(224, 242, 254, 0.8);
}

.form-actions {
  margin-top: 1.75rem;
  padding-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
  text-align: center;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  width: 100%;
  max-width: 100%;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

/* Messages */
.message {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-weight: 500;
  animation: message-in 0.4s ease;
  border: 1px solid transparent;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.message-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.message-info {
  background: #f0f9ff;
  color: #0c4a6e;
  border-color: #bae6fd;
}

/* Overview table */
.table-wrap {
  overflow-x: auto;
  background: var(--surface-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  animation: fade-rise 0.5s ease;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.95) 0%, rgba(224, 242, 254, 0.6) 100%);
  white-space: normal;
  line-height: 1.35;
  vertical-align: bottom;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.15s ease;
}

tr:hover td {
  background: rgba(14, 165, 233, 0.06);
}

td a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

td a:hover {
  text-decoration: underline;
}

.cell-bool-true {
  color: var(--success);
  font-weight: 700;
}

.cell-bool-false {
  color: var(--error);
  font-weight: 700;
}

td.cell-changed {
  background: rgba(3, 105, 161, 0.28);
  animation: highlight-fade 3s ease-out forwards;
}

@keyframes highlight-fade {
  0% {
    background: rgba(3, 105, 161, 0.45);
  }
  100% {
    background: transparent;
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state__icon {
  color: var(--accent);
  margin-bottom: 1rem;
}

.empty-state__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.empty-state__text {
  margin: 0 0 1.5rem;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.empty-state .btn {
  width: auto;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem;
  color: var(--text-muted);
  font-weight: 500;
}

.loading--panel {
  background: var(--surface-elevated);
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  box-shadow: var(--shadow);
}

/* `hidden` must override `.loading { display: flex }` or the loader stays visible */
[hidden] {
  display: none !important;
}

.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(14, 165, 233, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-footer__brand strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
}

.site-footer__brand span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer__legal {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Legacy .nav removed from HTML — keep minimal rules if linked elsewhere */
.nav {
  display: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
