/* Partner Security Onboarding — neutral B2B SaaS */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e5eb;
  --border-strong: #c9ced8;
  --text: #1a1d26;
  --text-secondary: #5c6475;
  --text-muted: #8b93a7;
  --primary: #2f3a4a;
  --primary-hover: #1f2733;
  --accent: #3d5a80;
  --accent-soft: #eef2f7;
  --danger: #b42318;
  --success: #067647;
  --demo: #6b7280;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --focus: 0 0 0 3px rgba(61, 90, 128, 0.25);
}

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

html { font-size: 15px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(145deg, #3d4a5c 0%, #1f2733 100%);
  border: 1px solid #18202b;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.brand-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Hide Netlify site chrome (badge / help) if injected */
a[href*="netlify.com"][style*="position"],
#netlify-badge,
.netlify-badge,
[data-netlify-badge],
iframe[src*="netlify"],
button[aria-label*="Netlify"],
div[id^="netlify-"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Main */
.main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 42rem;
}

/* Continuous form sections */
#onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem 1.75rem;
}


.panel-head {
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.section-divider {
  margin: 1.75rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.section-divider h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Grid / fields */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.15rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-span-2 { grid-column: span 2; }

.field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.req { color: var(--danger); font-weight: 600; }

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.field textarea { resize: vertical; min-height: 64px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: var(--danger);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.radio-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--surface);
  min-width: 88px;
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.radio-option input { margin: 0; accent-color: var(--accent); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 400 !important;
  cursor: pointer;
  line-height: 1.45;
}

.checkbox-row input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* Upload rows — intentionally dense / painful */
.upload-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.upload-row:nth-child(even) {
  background: #fafbfc;
}

.upload-row:last-child { border-bottom: none; }

.upload-row.is-required-empty .upload-title::after {
  content: " *";
  color: var(--danger);
}

.upload-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.upload-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.upload-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.upload-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.file-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: #f7f8fa;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.file-btn:hover { background: #eef0f3; }

.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name.has-file {
  color: var(--success);
  font-weight: 500;
}

.upload-row.has-file {
  background: #f6faf7;
}

/* Review */
.review-card {
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.88rem;
}

.review-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.45rem 1rem;
}

.review-card dt {
  color: var(--text-muted);
  font-weight: 500;
}

.review-card dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.review-card .review-section-title {
  grid-column: 1 / -1;
  margin: 0.65rem 0 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.review-card .review-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e8f5ee;
  color: var(--success);
}

.pill.warn {
  background: #fef3f2;
  color: var(--danger);
}

/* Footer actions */
.form-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

.footer-spacer { flex: 1; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 550;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  opacity: 0.55;
}

.btn-secondary:hover {
  opacity: 1;
  color: var(--text-secondary);
  background: #eef0f3;
}

/* Site footer */
.site-footer {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-muted { color: var(--text-muted); }

/* Submission success modal */
body.modal-open { overflow: hidden; }

.submission-modal[hidden] { display: none; }

.submission-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.submission-modal.is-visible { opacity: 1; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.success-modal {
  position: relative;
  width: min(420px, 100%);
  padding: 2.25rem 2rem 2rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.24);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}

.submission-modal.is-visible .success-modal {
  transform: translateY(0) scale(1);
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.15rem;
  border-radius: 50%;
  background: #e8f5ee;
  color: var(--success);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}

.success-modal h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 650;
}

.success-modal p {
  margin: 0.5rem 0 1.35rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* Film-friendly desktop width */
@media (min-width: 1280px) {
  .main, .topbar-inner, .site-footer {
    max-width: 920px;
  }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
  .upload-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .site-footer { flex-direction: column; }
}


/* Policy document text list */
.doc-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.doc-row:nth-child(even) {
  background: #fafafb;
}

.doc-row:last-child {
  border-bottom: none;
}

.doc-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0;
}

.doc-title {
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--text);
}

.doc-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.doc-input {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.doc-input:focus {
  outline: none;
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15);
}

@media (max-width: 720px) {
  .doc-row {
    grid-template-columns: 1fr;
  }
}
