/* ==========================================================================
   Vega Vision - Prospect Capture
   Dark navy field interface with the amber accent reserved for section labels,
   field numbers, the active step and the primary action.
   ========================================================================== */

/* --- Typeface: Montserrat (variable, self-hosted) ------------------------- */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* --- Tokens -------------------------------------------------------------- */

:root {
  --navy-950: #061726;
  --navy-900: #0a2337;
  --navy-800: #0c2a42; /* Vega Vision brand navy */
  --navy-750: #0f3050;
  --navy-700: #123a5c;
  --navy-600: #1b4a73;

  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);

  --ink: #eaf1f7;
  --ink-dim: #a9bed2;
  --ink-faint: #7e97ae;

  --amber: #f2a93b;
  --amber-strong: #ffbe5c;
  --amber-soft: rgba(242, 169, 59, 0.14);
  --amber-line: rgba(242, 169, 59, 0.5);

  --danger: #ff8a76;
  --danger-soft: rgba(255, 110, 90, 0.12);
  --danger-line: rgba(255, 110, 90, 0.45);

  --radius-card: 16px;
  --radius-input: 10px;
  --radius-pill: 12px;

  --touch: 52px; /* every interactive control clears the 48px minimum */
  --focus-ring: 0 0 0 3px rgba(242, 169, 59, 0.24);
}

/* --- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--navy-800);
  background-image:
    radial-gradient(1100px 720px at 82% -12%, rgba(27, 74, 115, 0.85) 0%, rgba(12, 42, 66, 0) 62%),
    linear-gradient(180deg, #0c2a42 0%, #071b2c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* Layout rules below set display on several containers, so keep [hidden] authoritative. */
[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--amber);
  color: #12212f;
  font-weight: 700;
  border-radius: 0 0 var(--radius-pill) 0;
}

.skip-link:focus {
  left: 0;
}

/* --- Shell --------------------------------------------------------------- */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Brand panel: slim header bar in portrait ---------------------------- */

.brand {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--navy-800);
  border-bottom: 1px solid var(--line);
}

.brand__inner {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand__logo {
  display: block;
  width: 172px;
  height: auto;
}

.brand__eyebrow,
.brand__heading,
.brand__sub,
.steps {
  display: none;
}

/* --- Form column --------------------------------------------------------- */

.form-area {
  flex: 1 1 auto;
  min-width: 0;
  padding: clamp(18px, 3vw, 40px);
}

.form {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 20px);
  max-width: 1120px;
  margin: 0 auto;
}

/* --- Cards --------------------------------------------------------------- */

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: clamp(18px, 2.2vw, 28px);
}

.card__head {
  margin-bottom: 18px;
}

.card__label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.card__slash {
  color: rgba(242, 169, 59, 0.45);
  margin: 0 2px;
}

.card__title {
  margin: 0;
  font-size: clamp(21px, 2.1vw, 27px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.card--confirm .helper {
  margin-bottom: 18px;
}

.helper {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-dim);
}

/* --- Fields -------------------------------------------------------------- */

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

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

.field__label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.field__label--legend {
  padding: 0;
}

.field__num {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
}

.field__req {
  font-size: 13px;
  color: var(--amber);
}

.input {
  width: 100%;
  min-height: var(--touch);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
  font-weight: 400;
  color: var(--ink);
  background: rgba(4, 18, 30, 0.55);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  appearance: none;
}

.input::placeholder {
  color: var(--ink-faint);
}

.input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: var(--focus-ring);
  background: rgba(4, 18, 30, 0.78);
}

.input--textarea {
  min-height: 124px;
  padding-top: 13px;
  line-height: 1.55;
  resize: vertical;
}

.input option {
  background-color: var(--navy-800);
  color: var(--ink);
}

.field__error {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--danger);
}

.field__error[hidden] {
  display: none;
}

.field.is-invalid .input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 110, 90, 0.14);
}

/* Select */

.select {
  position: relative;
}

.select select {
  padding-right: 44px;
  cursor: pointer;
}

.select select:invalid {
  color: var(--ink-faint);
}

.select__caret {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--ink-dim);
  border-bottom: 2px solid var(--ink-dim);
  transform: rotate(45deg);
  pointer-events: none;
}

/* --- Brochure cards ------------------------------------------------------ */

.brochures {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.brochures .field__label {
  margin-bottom: 4px;
}

.brochure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.brochure {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  -webkit-tap-highlight-color: transparent;
}

.brochure input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* The frame is a sibling of the input so the checked state needs no script. */
.brochure__frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.brochure__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brochure__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.15s ease;
}

.brochure__desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-dim);
}

.brochure__tick {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.brochure input:checked ~ .brochure__frame {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px rgba(242, 169, 59, 0.12);
}

.brochure input:checked ~ .brochure__body .brochure__name {
  color: var(--amber-strong);
}

.brochure input:checked ~ .brochure__tick {
  background: var(--amber);
  border-color: var(--amber);
}

.brochure input:checked ~ .brochure__tick::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312212f' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
}

.brochure input:focus-visible ~ .brochure__frame {
  border-color: var(--amber);
  box-shadow: var(--focus-ring);
}

.brochures.is-invalid .brochure__frame {
  border-color: var(--danger-line);
}

/* --- Consent ------------------------------------------------------------- */

.consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: var(--touch);
  padding: 15px 16px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.consent__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.consent__box {
  position: relative;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  margin-top: 1px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.consent__input:checked ~ .consent__box {
  background: var(--amber);
  border-color: var(--amber);
}

.consent__input:checked ~ .consent__box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312212f' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 17px 17px no-repeat;
}

.consent__input:checked ~ .consent__box {
  box-shadow: none;
}

.consent__input:focus-visible ~ .consent__box {
  box-shadow: var(--focus-ring);
}

.consent.is-invalid .consent__box {
  border-color: var(--danger);
}

.consent__text {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--touch);
  padding: 0 22px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--amber);
  color: #12212f;
}

.btn--primary:hover:not(:disabled) {
  background: var(--amber-strong);
}

.btn--primary:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--amber-line);
  color: var(--amber);
}

.btn--block {
  width: 100%;
}

.btn--save {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  font-size: 17px;
}

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(18, 33, 47, 0.28);
  border-top-color: #12212f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.btn.is-loading {
  cursor: progress;
}

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

/* --- Banner -------------------------------------------------------------- */

.banner {
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.5;
  color: #ffd9d2;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-pill);
}

.banner[hidden] {
  display: none;
}

/* --- Footer -------------------------------------------------------------- */

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 6px 26px;
}

.form-footer__line {
  font-size: 13px;
  color: var(--ink-faint);
}

.form-footer__admin {
  padding: 10px 6px;
  font-size: 13px;
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.form-footer__admin:hover {
  color: var(--amber);
  border-bottom-color: var(--amber-line);
}

/* --- Success modal ------------------------------------------------------- */

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

.modal[hidden] {
  display: none;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 26, 0.78);
}

.modal__card {
  position: relative;
  width: min(460px, 100%);
  padding: 34px 28px 28px;
  text-align: center;
  background: linear-gradient(180deg, var(--navy-750), var(--navy-900));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: modal-pop 0.22s ease-out;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: 50%;
}

.modal__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.modal__name {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--amber);
}

.modal__note {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-dim);
}

/* --- Landscape tablet: brand panel plus form ----------------------------- */

@media (orientation: landscape) and (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: minmax(290px, 30rem) minmax(0, 1fr);
    align-items: start;
  }

  .brand {
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(28px, 4.4vh, 52px) clamp(24px, 2.6vw, 44px);
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-950) 100%);
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .brand__inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .brand__logo {
    width: 196px;
    margin-bottom: clamp(24px, 4vh, 40px);
  }

  .brand__eyebrow {
    display: block;
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--amber);
  }

  .brand__heading {
    display: block;
    margin: 0 0 14px;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--ink);
  }

  .brand__sub {
    display: block;
    margin: 0;
    max-width: 32ch;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-dim);
  }

  .steps {
    display: block;
  }
}

/* --- Step indicator ------------------------------------------------------ */

.steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.steps__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding-left: 28px;
}

.steps__item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.steps__item:first-child::before {
  top: 50%;
}

.steps__item:last-child::before {
  bottom: 50%;
}

.steps__item::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--navy-800);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.steps__num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  transition: color 0.2s ease;
}

.steps__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-faint);
  transition: color 0.2s ease;
}

.steps__item.is-done .steps__num,
.steps__item.is-done .steps__label {
  color: var(--ink-dim);
}

.steps__item.is-done::after {
  background: var(--navy-600);
  border-color: var(--navy-600);
}

.steps__item.is-active .steps__num,
.steps__item.is-active .steps__label {
  color: var(--amber);
}

.steps__item.is-active::after {
  background: var(--amber);
  border-color: var(--amber);
}

/* --- Admin --------------------------------------------------------------- */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(18px, 3vw, 40px);
  background: var(--navy-800);
  border-bottom: 1px solid var(--line);
}

.admin-bar__logo {
  display: block;
  width: 168px;
  height: auto;
}

.admin-bar__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

.admin-bar__link {
  margin-left: auto;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--ink-dim);
  text-decoration: none;
}

.admin-bar__link:hover {
  color: var(--amber);
}

.admin-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 36px);
}

.admin-login {
  max-width: 520px;
  margin: 6vh auto 0;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.field--search {
  flex: 1 1 320px;
}

.admin-count {
  margin: 0;
  font-size: 13px;
  color: var(--ink-faint);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(4, 18, 30, 0.35);
}

.leads {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  white-space: nowrap;
}

.leads th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--navy-800);
  border-bottom: 1px solid var(--line);
}

.leads td {
  padding: 14px 16px;
  color: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.leads td:nth-child(7) {
  white-space: normal;
  min-width: 240px;
  color: var(--ink-dim);
}

.leads tbody tr:last-child td {
  border-bottom: 0;
}

.leads tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.admin-empty {
  margin: 0;
  padding: 22px;
  font-size: 14px;
  color: var(--ink-dim);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
}

.admin-empty[hidden] {
  display: none;
}

/* --- Narrow screens ------------------------------------------------------ */

@media (max-width: 720px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand__logo {
    width: 146px;
  }

  .admin-bar__title {
    display: none;
  }
}

/* --- Motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
