:root {
  --purple: #645f8b;
  --purple-dark: #514d73;
  --purple-light: #8b87ae;
  --page-bg: #eeedf4;
  --ink: #3a3752;
  --line: #c9c6dd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--purple);
  padding: 20px 0;
  position: relative;
}

.back-link {
  position: absolute;
  top: 10px;
  left: 16px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.back-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.header-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.og-logo {
  height: 84px;
  width: auto;
}

.site-header h1 {
  margin-left: auto;
  color: #fff;
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: 2px;
}

.site-header .divider {
  font-weight: 400;
  opacity: 0.7;
}

/* ---------- Sheet ---------- */
.sheet {
  width: 100%;
  max-width: 1020px;
  margin: 28px auto 40px;
  padding: 0 24px;
  flex: 1;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(100, 95, 139, 0.08);
}

.block.full {
  width: 100%;
}

.bar {
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-align: center;
  padding: 10px 14px;
  text-transform: uppercase;
}

.bar .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.8;
}

.bar-with-action {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bar-action {
  position: absolute;
  right: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.bar-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hint {
  font-size: 13px;
  color: #6d6a8a;
  padding: 14px 18px 0;
  line-height: 1.5;
}

.rows {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rows.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 12px;
}

.rows.collapsed {
  display: none;
}

.add-purchaser-row {
  margin: -8px 0 24px;
}

#add-purchaser {
  width: 100%;
  background: transparent;
  border: 2px dashed var(--purple-light);
  color: var(--purple);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

#add-purchaser:hover {
  background: rgba(100, 95, 139, 0.08);
  border-color: var(--purple);
}

.grid.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 14px 18px 20px;
}

.grid.four {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 14px 18px 20px;
}

.grid.four .field {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
}

/* ---------- Fields ---------- */
.field {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  gap: 10px;
}

.grid.three .field {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.field label small {
  font-weight: 400;
  color: #8d8aa8;
}

.req {
  color: #c0392b;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(100, 95, 139, 0.15);
}

input.invalid {
  border-color: #c0392b;
  background: #fdf3f2;
}

textarea {
  resize: vertical;
}

/* ---------- ID uploads ---------- */
.id-uploads {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 14px 16px 16px;
  background: #f4f3f9;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.upload-note {
  font-size: 12.5px;
  color: #55527a;
  line-height: 1.6;
  margin-bottom: 12px;
}

.upload-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field.file {
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

input[type="file"] {
  width: 100%;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 10px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--purple);
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .upload-fields {
    grid-template-columns: 1fr;
  }
}

/* Honeypot */
#website {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Errors & submit ---------- */
.form-error {
  background: #fdf3f2;
  border: 1px solid #e5b4ae;
  color: #a33025;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.turnstile-box {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.submit-row {
  text-align: center;
  margin: 8px 0 12px;
}

#submit-btn {
  background: var(--purple);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  border-radius: 6px;
  padding: 16px 56px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(100, 95, 139, 0.35);
}

#submit-btn:hover {
  background: var(--purple-dark);
}

#submit-btn:active {
  transform: translateY(1px);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---------- Success ---------- */
.success {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  padding: 60px 30px;
  box-shadow: 0 2px 10px rgba(100, 95, 139, 0.08);
}

.success-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 32px;
  line-height: 64px;
}

.success h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--purple);
  letter-spacing: 1px;
}

.success p {
  color: #6d6a8a;
  line-height: 1.7;
  margin-bottom: 26px;
}

#submit-another {
  background: transparent;
  border: 2px solid var(--purple);
  color: var(--purple);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 26px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#submit-another:hover {
  background: var(--purple);
  color: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 28px 20px 24px;
}

.brightstone-logo {
  height: 56px;
  width: auto;
  margin-bottom: 10px;
}

.site-footer p {
  font-size: 11px;
  color: #8d8aa8;
  letter-spacing: 0.3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .rows.two-col {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    gap: 10px;
  }

  .site-header h1 {
    margin-left: 0;
    text-align: center;
  }

  .field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
