:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d9e0e7;
  --soft: #eef3f7;
  --accent: #1668e3;
  --accent-dark: #0f55bd;
  --danger: #b42318;
  --success-bg: #ecfdf3;
  --success-text: #027a48;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button, input, textarea { font: inherit; }

.page-shell {
  width: min(980px, calc(100% - 32px));
  margin: 42px auto;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-header {
  padding: 34px 36px 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; }

h1 {
  font-size: clamp(1.6rem, 2.3vw, 2.2rem);
  letter-spacing: -0.03em;
}

.intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.form-section {
  padding: 28px 36px;
  border-bottom: 1px solid var(--line);
}

.form-section h2 {
  margin-bottom: 20px;
  font-size: 1.12rem;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field > span, legend {
  font-weight: 700;
  font-size: 0.93rem;
}

strong { color: var(--danger); }

input, textarea {
  width: 100%;
  border: 1px solid #c9d2dc;
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

textarea { resize: vertical; }

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 104, 227, 0.12);
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 2px 0 22px;
}

.choice-group legend { margin-bottom: 11px; }

.choices {
  display: grid;
  gap: 10px;
}

.choices.inline {
  grid-template-columns: repeat(3, max-content);
  gap: 10px 22px;
}

.choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  cursor: pointer;
}

.choices input { width: auto; }

.conditional {
  margin: 0 0 24px;
  padding: 18px 18px 0;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.conditional-title {
  margin-bottom: 16px;
  font-weight: 800;
}

.hidden { display: none !important; }

.final-section { border-bottom: 0; }

.actions, .review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.primary-button, .secondary-button, .icon-button {
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.primary-button {
  padding: 11px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

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

.secondary-button {
  padding: 11px 18px;
  background: #e9eef4;
  color: var(--text);
  font-weight: 750;
}

.form-message {
  display: none;
  margin: 0 0 18px;
  padding: 11px 13px;
  border-radius: 8px;
  font-weight: 700;
}

.form-message.error {
  display: block;
  background: #fef3f2;
  color: var(--danger);
}

.form-message.success {
  display: block;
  background: var(--success-bg);
  color: var(--success-text);
}

.review-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.review-dialog::backdrop { background: rgba(15, 23, 42, .55); }

.review-card { padding: 26px; }

.review-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 38px;
  height: 38px;
  font-size: 1.6rem;
  background: #edf1f5;
  color: #344054;
}

.review-content {
  margin: 20px 0;
  display: grid;
  gap: 14px;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.36fr) 1fr;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf0f3;
}

.review-label { font-weight: 800; color: #344054; }
.review-value { white-space: pre-wrap; color: #475467; }

.prototype-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

@media (max-width: 680px) {
  .page-shell { width: min(100% - 18px, 980px); margin: 16px auto; }
  .form-header, .form-section { padding-left: 20px; padding-right: 20px; }
  .two-column { grid-template-columns: 1fr; gap: 0; }
  .choices.inline { grid-template-columns: 1fr; }
  .actions, .review-actions { flex-direction: column-reverse; }
  .primary-button, .secondary-button { width: 100%; }
  .review-row { grid-template-columns: 1fr; gap: 5px; }
}

.field-help {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.camera-count-field {
  max-width: 300px;
}

.camera-details-section {
  margin: 8px 0 24px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.camera-details-heading {
  margin-bottom: 14px;
}

.camera-details-heading h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.camera-details-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.camera-rows {
  display: grid;
  gap: 12px;
}

.camera-row-card {
  padding: 15px 16px 0;
  background: #fff;
  border: 1px solid #d8e0e8;
  border-radius: 10px;
}

.camera-row-title {
  margin-bottom: 12px;
  font-weight: 800;
  color: #344054;
}

.camera-row-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.9fr;
  gap: 14px;
}

select {
  width: 100%;
  border: 1px solid #c9d2dc;
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  font: inherit;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 104, 227, 0.12);
}

@media (max-width: 760px) {
  .camera-row-grid { grid-template-columns: 1fr; gap: 0; }
  .camera-count-field { max-width: none; }
}


/* BP Network Services branding header */
.brand-header {
  background: #ffffff;
  border-bottom: 4px solid #3047c9;
  box-shadow: 0 2px 10px rgba(20, 30, 70, 0.08);
}

.brand-header__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo {
  display: block;
  width: min(430px, 82vw);
  height: auto;
  object-fit: contain;
}

@media (max-width: 640px) {
  .brand-header__inner {
    padding: 14px 16px 12px;
  }

  .brand-logo {
    width: min(340px, 88vw);
  }
}


.section-intro {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.photo-upload-box {
  display: grid;
  gap: 5px;
  padding: 22px;
  border: 2px dashed #b7c5d6;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.photo-upload-box:hover {
  border-color: var(--accent);
  background: #f4f8ff;
}

.photo-upload-title {
  font-weight: 800;
  color: #344054;
}

.photo-upload-help {
  color: var(--muted);
  font-size: 0.88rem;
}

.photo-upload-box input[type="file"] {
  margin-top: 10px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
}

.photo-selection-summary {
  margin-top: 16px;
}

.photo-selection-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  font-weight: 800;
  color: #344054;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  text-decoration: underline;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.photo-preview-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.photo-preview-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf1f5;
}

.photo-preview-meta {
  padding: 9px 10px 10px;
}

.photo-preview-name {
  overflow: hidden;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-preview-size {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.photo-note {
  margin-top: 12px;
}

@media (max-width: 520px) {
  .photo-selection-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Reusable toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #d8e0ea;
  border-left: 4px solid #175cd3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
  color: #1d2939;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-left-color: #039855;
}

.toast.error {
  border-left-color: #d92d20;
}

.toast.info {
  border-left-color: #175cd3;
}

.toast-message {
  line-height: 1.45;
  font-weight: 650;
}

.toast-close {
  border: 0;
  padding: 0;
  background: transparent;
  color: #667085;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#submitIntake.submitted {
  background: #027a48;
  border-color: #027a48;
}

@media (max-width: 640px) {
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .review-actions button {
    width: 100%;
  }
}


/* Version 7: review modal spacing and scrolling */
dialog.review-dialog {
  padding: 0;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.review-card {
  box-sizing: border-box;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px 28px 30px;
  scroll-padding-top: 28px;
  scroll-padding-bottom: 30px;
}

.review-list {
  margin-top: 8px;
}

.review-actions {
  margin-top: 22px;
  padding-top: 4px;
}

.prototype-note {
  margin-top: 18px;
  padding-top: 18px;
  padding-bottom: 2px;
}

@media (max-width: 640px) {
  dialog.review-dialog {
    max-height: calc(100vh - 24px);
  }

  .review-card {
    max-height: calc(100vh - 24px);
    padding: 22px 18px 24px;
    scroll-padding-top: 22px;
    scroll-padding-bottom: 24px;
  }
}
