/* Digilyt Intake Form — Styles */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --surface: #ffffff;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --error: #ef4444;
  --success: #10b981;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.form-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── Header ── */

.form-header {
  text-align: center;
  padding: 32px 0 24px;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.form-greeting {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ── Progress bar ── */

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.progress-step.active {
  color: var(--primary);
  border-color: var(--primary);
  background: #eff6ff;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.progress-step.active .step-number {
  background: var(--primary);
  color: white;
}

.progress-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

/* ── Form steps ── */

.form-step { display: none; }
.form-step.active { display: block; }

.step-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.optional-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

/* ── Fields ── */

.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.req { color: var(--error); }

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-group textarea { resize: vertical; }

.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea {
  border-color: var(--error);
}

.field-error {
  display: block;
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  min-height: 16px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* ── Radio group ── */

.radio-group {
  display: flex;
  gap: 16px;
  padding-top: 6px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.radio-label input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
}

/* ── Section divider ── */

.section-divider {
  margin-top: 32px;
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.section-divider h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Buttons ── */

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ── Error banner ── */

.form-error-banner {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
}

/* ── Footer ── */

.form-footer {
  text-align: center;
  padding: 32px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Upload zone ── */

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.upload-text {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-browse {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.upload-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  background: #f8fafc;
}

.upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-item .upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e2e8f0;
}

.upload-item .upload-progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.upload-item .upload-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  font-size: 10px;
  color: white;
  background: rgba(0,0,0,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-item .upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.upload-item:hover .upload-remove {
  opacity: 1;
}

.upload-item.uploading {
  opacity: 0.7;
}

.upload-item.error {
  border-color: var(--error);
}

/* ── Thank you / Expired pages ── */

.message-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 80px 16px;
  text-align: center;
}

.message-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.message-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}

.message-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}
