:root {
  --brand: #ff385c;
  --brand-hover: #e31c5f;
  --brand-dark: #d91f4d;
  --ink: #222222;
  --ink-2: #484848;
  --muted: #717171;
  --line: #ebebeb;
  --surface: #ffffff;
  --canvas: #f7f7f7;
  --soft: #fcfcfc;
  --warning: #f5a623;
  --success: #008a05;
  --danger: #e21c3f;
  --focus: rgba(255, 56, 92, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 14px 28px rgba(0, 0, 0, 0.12), 0 10px 10px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --transition: 0.2s cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 70px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.text-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  color: var(--brand);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0;
  transition: transform var(--transition);
}
.text-logo:hover {
  transform: scale(1.02);
}

.text-logo .logo-icon {
  font-size: 28px;
  margin-right: 2px;
  color: var(--brand);
}

.text-logo .logo-bold {
  font-weight: 800;
  color: var(--brand);
}

.text-logo .logo-light {
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--brand);
}

.nav-back {
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}
.nav-back:hover {
  color: var(--brand);
}

.onboarding-shell {
  width: min(1200px, calc(100vw - 48px));
  margin: 40px auto 80px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 32px;
}

/* Modal styles for the OTP dialog */
dialog.otp-modal {
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0;
  max-width: 440px;
  width: 100%;
  background: transparent;
}

dialog.otp-modal::backdrop {
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(8px);
}

.modal-box {
  background: var(--surface);
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-box h3 {
  margin: 0;
  font-size: 24px;
}

.modal-box p {
  color: var(--muted);
  margin-bottom: 8px;
}

.process-panel,
.verify-panel,
.auth-panel,
.wizard-panel,
.review-panel,
.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.process-panel {
  position: sticky;
  top: 88px;
  top: 110px;
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  height: max-content;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  border: 1px solid var(--line);
}

.process-panel::-webkit-scrollbar {
  width: 6px;
}
.process-panel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.panel-kicker {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.process-panel h1 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.panel-copy {
  color: #555555;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 32px;
  letter-spacing: -0.01em;
}

.session-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--canvas);
  border-radius: var(--radius);
  margin-bottom: 32px;
  border: 1px solid var(--line);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  margin-top: 6px;
  box-shadow: 0 0 0 4px rgba(113, 113, 113, 0.1);
  transition: all var(--transition);
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(0, 138, 5, 0.15);
}

.status-dot.in-progress {
  background: #f5a623;
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.15);
}

.status-dot.pending {
  background: #4a90e2;
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15);
}

.session-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}

.session-card span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.step-rail {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.step-rail li {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.step-rail li.active {
  color: var(--ink);
  border-color: var(--brand);
  background: #fff5f7;
}

.step-rail li.locked {
  color: var(--success);
  border-color: #bde7ce;
  background: #f1faf5;
}

.step-rail li.reopen {
  color: var(--warning);
  border-color: #f4d27a;
  background: #fff9e8;
}

.security-note {
  margin-top: 32px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.security-note strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
  font-weight: 700;
}
.security-note span {
  color: var(--muted);
}

.workspace {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  min-height: 600px;
}

.section-head {
  margin-bottom: 40px;
  animation: slideUp 0.4s ease-out;
}

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.section-head h2 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.section-head p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.verify-panel,
.auth-panel,
.wizard-panel,
.review-panel {
  padding: 28px;
  animation: slideUp 0.4s ease-out;
}

.auth-panel {
  max-width: 440px;
}

.summary-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.summary-card h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.summary-list,
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-list div,
.review-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.summary-list span,
.review-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-list strong,
.review-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 24px;
  animation: slideUp 0.4s ease-out;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full,
.action-row,
.check-group,
.file-list,
.agreement-box {
  grid-column: 1 / -1;
}

.field span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: #a0a0a0;
}

.file-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  background: var(--canvas);
  cursor: pointer;
  transition: all var(--transition);
}
.file-drop:hover {
  border-color: var(--brand);
  background: var(--soft);
}

input[readonly],
input[disabled] {
  color: var(--muted);
  background: #f3f5f8;
}

.otp-field {
  display: none;
}

.otp-field.show {
  display: grid;
}

.check-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.check-grid label,
.agreement-box label {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.check-grid input,
.agreement-box input {
  width: 16px;
  min-height: 16px;
  flex: none;
}

.file-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.file-pill {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.agreement-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cad7df;
  border-radius: var(--radius);
  background: var(--soft);
}

.agreement-terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agreement-terms div {
  padding: 12px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.agreement-terms span,
.agreement-terms strong {
  display: block;
}

.agreement-terms span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(to right, var(--brand), var(--brand-hover));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 56, 92, 0.2);
}
.btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 56, 92, 0.3);
}

.btn.primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.secondary:hover:not(:disabled) {
  background: var(--canvas);
  border-color: var(--muted);
}

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

.inline-link {
  display: inline-flex;
  align-items: center;
  margin-top: 22px;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  color: #fff;
  border-radius: var(--radius);
  background: #263238;
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

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

#toast.success {
  background: var(--success);
}

#toast.error {
  background: var(--danger);
}

@media (max-width: 920px) {
  .onboarding-shell {
    grid-template-columns: 1fr;
  }

  .process-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 18px;
  }

  .onboarding-shell {
    width: min(100vw - 20px, 680px);
    margin-top: 14px;
  }

  .verify-panel,
  .wizard-panel,
  .review-panel,
  .process-panel {
    padding: 18px;
  }

  .form-grid,
  .summary-list,
  .review-grid,
  .agreement-terms {
    grid-template-columns: 1fr;
  }

  .check-grid {
    grid-template-columns: 1fr 1fr;
  }

  .action-row {
    flex-direction: column;
  }
}
