:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  --border-focus: #2563eb;
  --primary: #0099da;
  --primary-hover: #0088c2;
  --secondary: #111827;
  --secondary-hover: #1f2937;
  --success-bg: #ecfdf5;
  --success-text: #166534;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
  --page-top-space: clamp(1.5rem, 5vw, 5.5rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30%),
    radial-gradient(circle at bottom right, rgba(17, 24, 39, 0.06), transparent 30%),
    url("./bg.png"),
    var(--bg);
  color: var(--text);
  background-repeat: no-repeat;
  background-size: cover;
  padding-top: var(--page-top-space);
}

/* Header image */

.hero-shell {
  width: 100%;
  margin: 0 0 24px;
}

.hero-banner {
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
  overflow: hidden;
  background: var(--surface);
}

.header-image {
  width: 100%;
  height: 300px;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

/* Shared card layout */

.contact-shell,
.thank-you-shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto 72px;
  padding: 0 16px;
}

.contact-card,
.thank-you-card {
  background: var(--surface);
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.contact-header {
  padding: 32px 32px 20px;
}

.header-copy {
  padding-top: 32px;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}

.subtext {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 54ch;
}

/* Form */

form {
  padding: 12px 32px 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  margin-bottom: 18px;
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input::placeholder {
  color: #9ca3af;
}

input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 54px;
  background-clip: padding-box;
}

.search-wrap {
  position: relative;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
}

.search-results[hidden] {
  display: none;
}

.search-option {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  line-height: 1.4;
  cursor: pointer;
}

.search-option:hover,
.search-option:focus {
  background: rgba(37, 99, 235, 0.08);
  outline: none;
}

.field-help {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

button,
.button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 15px 22px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--secondary);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

button:hover,
.button:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.status {
  min-height: 24px;
  padding: 0 2px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.status-loading {
  color: var(--muted);
}

.status-success,
.status-error {
  padding: 12px 14px;
  border-radius: 12px;
}

.status-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-error {
  background: var(--error-bg);
  color: var(--error-text);
}

/* Rules modal */

.rules-link-wrap {
  margin-top: 8px;
  text-align: center;
}

.rules-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: #0099da;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.rules-link:hover,
.rules-link:focus {
  color: #0099da;
  background: transparent;
  outline: none;
  transform: none;
  text-decoration: none;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
}

.modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(80vh, 800px);
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.24);
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.modal p {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.65;
}

/* Thank-you page */

.thank-you-card {
  padding: 48px 32px;
  text-align: center;
}

.thank-you-card .subtext {
  margin: 0 auto;
  font-size: 1.05rem;
  max-width: 48ch;
}

.icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 2rem;
  font-weight: 800;
}

.cta-box {
  margin: 32px auto 0;
  padding: 24px;
  border-radius: 22px;
  background: #f9fafb;
  border: 1px solid rgba(17, 24, 39, 0.08);
  max-width: 560px;
}

.cta-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.cta-text {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.button-wrap {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.button-primary {
  background: var(--primary);
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-secondary {
  padding: 11px 18px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
}

.button-secondary:hover {
  color: var(--text);
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Responsive */

@media (max-width: 640px) {
  .header-image {
    height: 180px;
    min-height: 180px;
  }

  .contact-header,
  form {
    padding-left: 20px;
    padding-right: 20px;
  }

  form {
    padding-bottom: 32px;
  }

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

  .thank-you-card {
    padding: 40px 20px;
  }

  .cta-box {
    padding: 20px;
  }

  .button {
    width: 100%;
  }
}
