/* ============================================================
   Caribbean Closers — Openings signup
   Brand: purple #662D91 / orange #E2911E, sampled from the logo.
   Committed light design: the logo ships on a solid #f7f7f7
   background (no alpha), so the card matches that shade exactly
   and the logo sits on it seamlessly.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --page-bg:       #ecebef;
  --tint-purple:   rgba(102, 45, 145, .10);
  --tint-orange:   rgba(226, 145, 30, .11);

  --surface:       #f7f7f7;  /* matches the logo's baked-in background */
  --input-bg:      #ffffff;
  --border:        #dedbe4;
  --border-strong: #c3bccd;

  --text:          #241a2e;
  --text-muted:    #6b6275;

  --brand:         #662d91;
  --brand-hover:   #55247a;
  --brand-ring:    rgba(102, 45, 145, .18);

  --accent:        #e2911e;  /* decorative only — too light for text */

  --danger:        #c0392b;
  --success:       #1e7a4a;

  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 1px 2px rgba(36, 26, 46, .05),
                   0 14px 36px -10px rgba(36, 26, 46, .18);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--page-bg);
  background-image:
    radial-gradient(1000px 540px at 86% -10%,  var(--tint-purple), transparent 62%),
    radial-gradient(780px  480px at -8% 106%,  var(--tint-orange), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.page {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.card {
  position: relative;
  /* margin:auto centres the card vertically when there is room and
     lets it scroll normally when the form is taller than the screen —
     align-items:center would clip the top instead. */
  margin: auto;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 32px 30px;
  overflow: hidden; /* keeps the accent bar inside the rounded corners */
}

/* Brand bar across the top of the card */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 100%);
}

/* ---------- Header ---------- */
.card__header {
  margin-bottom: 24px;
  text-align: center;
}

.logo {
  display: block;
  width: 100%;
  max-width: 268px;
  height: auto;
  margin: 4px auto 20px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 1.24rem + 1vw, 1.8rem);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.lede {
  margin: 0;
  color: var(--text-muted);
  font-size: .925rem;
  line-height: 1.55;
}

/* ---------- Fields ---------- */
.field { margin-bottom: 16px; }

label {
  display: block;
  margin-bottom: 7px;
  font-size: .875rem;
  font-weight: 550;
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming on focus */
  color: var(--text);
  background-color: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  -webkit-appearance: none;
}

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

/* Chevron for the country select */
select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236b6275' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  cursor: pointer;
}

/* Grey the select while it still shows the "Select your country" option */
select:required:invalid { color: var(--text-muted); }
select option { color: var(--text); }

input:hover:not(:focus),
select:hover:not(:focus) { border-color: var(--brand); }

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

input[aria-invalid="true"],
select[aria-invalid="true"] { border-color: var(--danger); }

input[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(192, 57, 43, .16);
}

.error {
  margin: 6px 0 0;
  font-size: .8125rem;
  color: var(--danger);
}

/* Collapse unused error slots so four fields still fit a phone screen */
.error:empty { display: none; }

/* ---------- Honeypot ---------- */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Button ---------- */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 10px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .15s ease, transform .08s ease, opacity .15s ease;
}

.btn:hover  { background: var(--brand-hover); }
.btn:active { transform: translateY(1px); }

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.btn[disabled] { cursor: not-allowed; opacity: .72; }

.btn__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn.is-loading .btn__spinner { display: block; }

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

/* ---------- Status + consent ---------- */
.form-status {
  margin: 14px 0 0;
  font-size: .875rem;
  text-align: center;
}
.form-status:empty { margin: 0; }
.form-status.is-error   { color: var(--danger); }
.form-status.is-success { color: var(--success); }

.form-status a { color: var(--brand); font-weight: 600; }

.consent {
  margin: 16px 0 0;
  font-size: .75rem;
  line-height: 1.55;
  text-align: center;
  color: var(--text-muted);
}

.consent a {
  color: var(--brand);
  font-weight: 550;
  text-underline-offset: 2px;
}

.consent a:hover { color: var(--brand-hover); }

/* ---------- Responsive ---------- */

/* Phones */
@media (max-width: 480px) {
  .page { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
  .card { padding: 26px 20px 24px; border-radius: 14px; }
  .card__header { margin-bottom: 20px; }
  .logo { max-width: 210px; margin-bottom: 16px; }
  .lede { font-size: .9rem; }
}

/* Tablets and up */
@media (min-width: 768px) {
  .card { max-width: 480px; padding: 40px 40px 36px; }
  .logo { max-width: 288px; }
}

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