/* ========================================
   Client Intake Form
   Aesthetic: minimalist-skill (warm monochrome, editorial, flat)
   ======================================== */

:root {
  --bg: #FBFBFA;
  --surface: #FFFFFF;
  --text: #2F3437;
  --text-secondary: #787774;
  --border: #EAEAEA;
  --border-focus: #C8C8C4;
  --accent: #111111;
  --accent-hover: #333333;
  --error: #9F2F2D;
  --error-bg: #FDEBEC;
  --success: #346538;
  --success-bg: #EDF3EC;
  --blue-bg: #E1F3FE;
  --blue-text: #1F6C9F;
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

/* ===== VIEWS ===== */

.view {
  display: none;
  min-height: 100dvh;
}
.view.active { display: flex; }

/* ===== ENTRY ===== */

#entry {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.entry-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.entry-title {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.entry-sub {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 15px;
  line-height: 1.5;
}

/* Language toggle */

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.lang-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}

.lang-btn.active {
  background: var(--accent);
  color: #FFFFFF;
}

.lang-btn:not(.active):hover {
  background: #F7F6F3;
}

/* ===== FORM HEADER ===== */

.form-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  padding: 16px 24px;
}

.form-header-inner {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s ease;
  width: 25%;
}

/* ===== FORM BODY ===== */

#form-view {
  flex-direction: column;
}

.form-body {
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

.form-step h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}

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

/* ===== FIELDS ===== */

.field {
  margin-bottom: 24px;
}

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

.field-hint {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

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

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--border-focus);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

::placeholder {
  color: #C4C4C0;
}

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

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

/* ===== RADIO GROUPS ===== */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}

.radio-label:hover {
  border-color: var(--border-focus);
}

.radio-label:has(input:checked) {
  border-color: var(--accent);
  background: #FAFAF9;
}

.radio-label input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--accent);
}

.radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}

/* ===== COLOR INPUTS ===== */

.color-inputs {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: var(--surface);
}

.color-hex {
  width: 80px !important;
  font-family: var(--font-mono);
  font-size: 13px !important;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .color-inputs { flex-direction: column; }
}

/* ===== SOCIAL INPUTS ===== */

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

.social-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #F7F6F3;
  border-radius: 6px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.social-row input {
  flex: 1;
}

/* ===== UPLOAD ZONES ===== */

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

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

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.upload-prompt svg {
  opacity: 0.4;
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}

.upload-list:not(:empty) {
  padding: 12px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #F7F6F3;
  border-radius: 6px;
  font-size: 13px;
  position: relative;
}

.upload-item .file-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item .remove-file {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s;
}

.upload-item .remove-file:hover {
  background: var(--border);
}

.upload-item .upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 6px 6px;
  transition: width 0.15s;
}

.upload-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-width: 120px;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ===== LOADING ===== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(251, 251, 250, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-overlay.hidden { display: none; }

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== HIDDEN ===== */

.hidden { display: none !important; }

/* ===== COMPLETE ===== */

#complete {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#complete .entry-title {
  margin-bottom: 12px;
}

/* ===== MOBILE ===== */

@media (max-width: 520px) {
  .entry-title { font-size: 34px; }
  .form-step h2 { font-size: 26px; }
  .form-body { padding: 28px 20px 60px; }
  .step-actions { flex-direction: column-reverse; gap: 12px; }
  .step-actions .btn-primary,
  .step-actions .btn-secondary { width: 100%; }
}
