/* ─── Parsec Web App — Shared Styles ─────────────────────────────────────── */

:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;

  --bg:           #F6F8FC;
  --surface:      #FFFFFF;
  --surface2:     #EEF2F8;
  --border:       #DDE3EE;
  --border-focus: #0066CC;

  --text-primary:   #0D1626;
  --text-secondary: #4A5568;
  --text-muted:     #8896AA;

  --accent:       #0066CC;
  --accent-dark:  #004FA3;
  --accent-light: #E8F0FD;
  --accent-hover: #EBF2FF;

  --green:        #1A7A4A;
  --green-light:  #E6F5EE;
  --red:          #B91C1C;
  --red-light:    #FEE2E2;
  --amber:        #92600A;
  --amber-light:  #FEF3C7;

  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;
  --shadow:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.10);
}

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

html { scroll-behavior: smooth; }

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

/* ─── Form Layout ──────────────────────────────────────────────────────────── */

.page-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-header {
  margin-bottom: 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

.page-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.page-logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.page-logo-text em {
  font-style: normal;
  font-weight: 300;
  color: var(--text-secondary);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 8px;
}

.page-title strong {
  font-weight: 600;
  color: var(--accent);
}

.page-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── Form Card ────────────────────────────────────────────────────────────── */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ─── Form Fields ──────────────────────────────────────────────────────────── */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

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

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
}

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

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

label .required {
  color: var(--accent);
  margin-left: 2px;
}

label .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
  background: white;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238896AA' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-error {
  font-size: 0.78rem;
  color: var(--red);
  display: none;
}

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

.field.has-error .field-error {
  display: block;
}

/* ─── Checkbox / Radio Groups ──────────────────────────────────────────────── */

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

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
}

.check-item:hover {
  border-color: var(--accent);
  background: var(--accent-hover);
}

.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-item.checked {
  border-color: var(--accent);
  background: var(--accent-light);
}

.check-label {
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,102,204,0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

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

/* ─── Status / Alerts ──────────────────────────────────────────────────────── */

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(26,122,74,0.2);
}

.alert-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(185,28,28,0.2);
}

.alert-info {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(0,102,204,0.2);
}

/* ─── Progress Steps ───────────────────────────────────────────────────────── */

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.2s;
}

.step.active .step-num {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.step.done .step-num {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.step.active .step-label { color: var(--accent); font-weight: 600; }
.step.done .step-label   { color: var(--green); }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

/* ─── Success State ────────────────────────────────────────────────────────── */

.success-screen {
  text-align: center;
  padding: 48px 24px;
  display: none;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--green);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.success-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto 32px;
}

/* ─── Divider ──────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ─── Spinner ──────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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