@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-dark: #111827;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --bg-page: #f8fafc;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-focus: #2563eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 40px rgba(37,99,235,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* ===== PUBLIC FORM HEADER ===== */
.form-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
  color: white;
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.form-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
  animation: shimmer 15s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20%, 20%); }
}
.form-header .logo { position: relative; z-index: 1; margin-bottom: 1rem; }
.form-header .logo img { max-height: 70px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2)); }
.form-header .title { position: relative; z-index: 1; }
.form-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.form-header p { font-size: 0.875rem; opacity: 0.85; max-width: 600px; margin: 0 auto; line-height: 1.5; }

/* ===== FORM CONTAINER ===== */
.form-container {
  max-width: 800px;
  margin: -1.5rem auto 2rem;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

/* ===== STEPPER ===== */
.stepper {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-light);
  position: relative;
}
.stepper-step.active {
  color: var(--primary);
  font-weight: 600;
}
.stepper-step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--border);
  color: white;
  flex-shrink: 0;
}
.stepper-step.active .step-num {
  background: var(--primary);
}
.stepper-step.completed .step-num {
  background: var(--success);
}
.stepper-connector {
  width: 40px;
  height: 2px;
  background: var(--border);
  align-self: center;
  flex-shrink: 0;
}

/* ===== FORM SECTIONS ===== */
.form-section-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}
.form-section-card:hover {
  box-shadow: var(--shadow-md);
}
.form-section-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.form-section-header .section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.form-section-header .section-icon.blue { background: #dbeafe; color: #2563eb; }
.form-section-header .section-icon.amber { background: #fef3c7; color: #d97706; }
.form-section-header .section-icon.rose { background: #ffe4e6; color: #e11d48; }
.form-section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}
.form-section-body {
  padding: 1.5rem;
}

/* ===== FORM FIELDS ===== */
.field-group { margin-bottom: 1.25rem; }
.field-group:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.375rem;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-dark);
  background: white;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-light);
}
.field-textarea {
  min-height: 100px;
  resize: vertical;
}
.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.field-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.25rem;
  display: none;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ===== RADIO & CHECKBOX ===== */
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.option-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}
.option-item input[type="checkbox"] { border-radius: 4px; }
.option-item input[type="radio"]:checked,
.option-item input[type="checkbox"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}
.option-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}
.option-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.option-item input[type="radio"]:focus,
.option-item input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.option-item label {
  font-size: 0.875rem;
  color: var(--text-dark);
  cursor: pointer;
  user-select: none;
}
.option-item input.errorField,
.option-item input.errorField + label {
  border-color: var(--danger);
}
.input-text-error {
  display: block;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.25rem;
}

/* ===== DISCLAIMER ===== */
.disclaimer-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-gray);
}
.disclaimer-box strong {
  color: var(--text-dark);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-outline {
  background: transparent;
  color: var(--text-gray);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #059669;
}
.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
}
.btn-full { width: 100%; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== ALERTS ===== */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ===== FOOTER ===== */
.form-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-light);
}
.form-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.form-footer a:hover { text-decoration: underline; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.loading-pulse {
  animation: pulse-soft 1.5s ease-in-out infinite;
}

/* ===== ERROR FIELD STATE ===== */
.errorField {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
