:root {
  --primary: #0050b3;
  --primary-soft: #e8f1ff;
  --primary-strong: #002766;
  --accent: #1890ff;
  --bg: #f3f5f9;
  --border-subtle: #dde3f0;
  --danger: #cf1322;
  --text-main: #1f2933;
  --text-muted: #727b88;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #f0f5ff, #f9fafc);
  padding: 24px 12px;
  display: flex;
  justify-content: center;
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
}

.container {
  width: 100%;
  max-width: 1040px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  padding: 22px 22px 28px;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-strong);
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 600;
}

.meta-pill.secondary {
  background: rgba(24, 144, 255, 0.09);
  color: #0958d9;
}

/* Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f2f4fa;
  color: var(--text-muted);
  font-size: 0.8rem;
  position: relative;
  overflow: hidden;
}

.step::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 80, 179, 0.08), rgba(24, 144, 255, 0.08));
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.step-number {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #dde3f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #334155;
}

.step-label {
  position: relative;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.step.active {
  color: var(--primary-strong);
  font-weight: 600;
  background: var(--primary-soft);
}

.step.active::before {
  opacity: 1;
}

.step.active .step-number {
  background: var(--primary);
  color: #ffffff;
}

.step.completed .step-number {
  background: var(--accent);
  color: #ffffff;
}

/* Form + groups */
form {
  margin-top: 6px;
}

.step-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.step-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field-group {
  background: #f9fafc;
  border-radius: var(--radius-md);
  padding: 16px 16px 12px;
  border: 1px solid var(--border-subtle);
}

.field-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-strong);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-group-title::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

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

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

label {
  font-size: 0.8rem;
  color: var(--text-main);
}

.required {
  color: var(--danger);
  margin-left: 3px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  background: #ffffff;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(24, 144, 255, 0.25);
  background: #ffffff;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-main);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.divider {
  margin: 16px 0 12px;
  border-top: 1px dashed var(--border-subtle);
}

.spacer {
  height: 12px;
}

/* File input */
.file-input {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
  padding: 14px 14px 10px;
  background: #f4f7ff;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-input p {
  margin: 0 0 4px;
}

.file-input input {
  margin-top: 6px;
}

/* Signature */
.signature-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  background: #f9fafc;
}

.signature-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px dashed #c4cdde;
  background: #ffffff;
  cursor: crosshair;
}

.signature-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 8px;
}

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

/* Buttons */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.actions-right {
  display: flex;
  gap: 8px;
}

.btn {
  border-radius: 999px;
  padding: 8px 16px;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease, color 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 80, 179, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 10px 24px rgba(0, 80, 179, 0.32);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-outline:not(:disabled):hover {
  background: #f3f6ff;
}

.btn-ghost {
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px dashed transparent;
}

.btn-ghost:hover {
  border-color: var(--border-subtle);
  background: #ffffff;
}

.error {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 4px;
}

.message {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 18px 14px 22px;
    border-radius: 12px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

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

  .actions-right {
    width: 100%;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }
}

.cdp-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

input[type="email"] {
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(24, 144, 255, 0.25);
  background: #ffffff;
}


