/* Base styles */
:root {
  --bg: #0b1220;
  --surface: #0f172a;
  --text: #0f172a;
  --text-invert: #ffffff;
  --muted: #64748b;
  --primary: #0ea5e9;
  --primary-600: #0284c7;
  --ring: rgba(14, 165, 233, 0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color: var(--text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; }
input, button { outline: none; }

/* Honor the hidden attribute even if component styles set display */
[hidden] { display: none !important; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: 10px; font-weight: 600; border: 1px solid transparent;
  transition: transform .06s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-600); transform: translateY(-1px); }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  background-color: #3b0d9e;
  background-image:
    radial-gradient(1200px 600px at 70% 30%, rgba(255,255,255,0.15), rgba(255,255,255,0) 60%),
    radial-gradient(1000px 500px at 20% 60%, rgba(0,0,0,0.35), rgba(0,0,0,0.0) 55%),
    url('/assets/hero-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-content { max-width: 880px; margin: 0 auto; padding: 72px 24px; }
.hero-eyebrow { letter-spacing: 0.16em; font-weight: 800; opacity: .9; }
.hero-title { margin: 10px 0 14px; font-size: 40px; line-height: 1.15; letter-spacing: .02em; }
.hero-sub { color: rgba(255,255,255,.9); margin: 0 auto 24px; max-width: 720px; }
.cta-row { display: inline-flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.button.white { background: #fff; color: #0f172a; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.button.white:hover { transform: translateY(-1px); }
.button.dark { background: rgba(0,0,0,.35); color: #fff; border-color: rgba(255,255,255,.2); backdrop-filter: blur(2px); }
.button.dark:hover { background: rgba(0,0,0,.45); transform: translateY(-1px); }
.button.ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.button.ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.hero-terms { color: rgba(255,255,255,.85); }
.hero-terms a { color: rgba(255,255,255,.9); text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); transition: all 0.2s ease; }
.hero-terms a:hover { color: #ffffff; text-decoration-color: rgba(255,255,255,.8); }
.hero-terms, .hero-mark { position: absolute; bottom: 16px; }
.hero-terms { left: 16px; }
.hero-mark { right: 16px; opacity: .95; }
/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background-color: rgba(11, 18, 32, 0.86);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* Prevent overlay from creating a page scrollbar; let modal content scroll instead */
  overflow: hidden;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(2, 8, 23, 0.45);
  max-width: 600px;
  width: 100%;
  /* Ensure modal fits within typical laptop screens while accounting for overlay padding */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  position: relative;
  padding: 24px;
}

/* Use dynamic viewport units where supported to avoid browser UI issues */
@supports (height: 100dvh) {
  .modal-content {
    max-height: calc(100dvh - 48px);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  background: #f8fafc;
}

.modal-header {
  margin-bottom: 20px;
  padding-right: 40px;
}

.modal-title {
  font-size: 24px;
  color: #0f172a;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.modal-sub {
  font-size: 14px;
  color: #475569;
}

.modal-sub a {
  color: var(--primary);
  text-decoration: none;
}

.modal-sub a:hover {
  text-decoration: underline;
}

/* Form styles */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

.label {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
}

.input {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 12px;
  font: inherit;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

.input-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
}

.cc-select {
  height: 42px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0 10px;
  font: inherit;
  color: #0f172a;
}

/* Textarea improvements */
textarea.input {
  padding: 14px 14px;
  line-height: 1.4;
  resize: vertical;
  min-height: 80px;
}

/* Softer placeholder aesthetics */
textarea.input::placeholder {
  color: #64748b;
}

.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #334155;
  line-height: 1.4;
}

.terms input[type="checkbox"] {
  margin-top: 2px;
}

.terms a {
  color: var(--primary);
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}

.submit-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.submit-row .button {
  height: 42px;
  font-weight: 600;
}

.submit-row .button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  color: #b91c1c;
  font-size: 14px;
  display: none;
}

.success {
  color: #065f46;
  font-size: 14px;
  display: none;
}

/* Responsive */
@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .modal-content {
    padding: 32px;
  }
}

/* Compact layout for short laptop screens to ensure fit */
@media (max-height: 820px) {
  .modal-content { padding: 18px; }
  .modal-header { margin-bottom: 12px; }
  .modal-title { font-size: 22px; }
  .modal-form { gap: 12px; }
  .field { gap: 4px; }
  .submit-row { margin-top: 4px; }
  textarea.input { max-height: 140px; }
}
