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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fff;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  width: 120px;
  height: auto;
  margin-bottom: 16px;
  opacity: 0.85;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.subtitle {
  color: #666;
  font-size: 0.95rem;
}

/* Progress */
.progress-bar {
  height: 3px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #1a1a1a;
  border-radius: 2px;
  width: 14.28%;
  transition: width 0.3s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}

.step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f5f5f5;
  color: #999;
  transition: all 0.2s ease;
}

.step.active {
  background: #1a1a1a;
  color: #fff;
}

.step.completed {
  background: #1a1a1a;
  color: #fff;
}

/* Form sections */
.form-section {
  display: none;
  border: none;
  padding: 0;
}

.form-section.active {
  display: block;
}

legend {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
  width: 100%;
}

/* Fields */
.field {
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #1a1a1a;
}

.required {
  color: #c00;
}

.helper-text {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  outline: none;
  border-color: #1a1a1a;
}

textarea {
  resize: vertical;
}

/* Radio and checkbox groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-label:hover,
.checkbox-label:hover {
  border-color: #bbb;
  background: #fafafa;
}

.radio-label input,
.checkbox-label input {
  margin: 0;
  accent-color: #1a1a1a;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compliance-check {
  align-items: flex-start;
  line-height: 1.5;
  padding: 12px;
  background: #f9f9f9;
}

.compliance-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

/* Phone group */
.phone-group {
  display: flex;
  gap: 8px;
}

.phone-code-wrapper {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 0 8px;
  transition: border-color 0.15s ease;
}

.phone-code-wrapper:focus-within {
  border-color: #1a1a1a;
}

.phone-code-prefix {
  font-size: 0.9rem;
  color: #666;
  user-select: none;
}

.phone-code-input {
  width: 50px !important;
  border: none !important;
  padding: 10px 4px !important;
  font-size: 0.9rem;
}

.phone-code-input:focus {
  outline: none;
}

.phone-code-wrapper .select-dropdown {
  left: -1px;
  right: auto;
  width: 180px;
}

/* Searchable select */
.searchable-select {
  position: relative;
}

.select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.select-dropdown.open {
  display: block;
}

.select-option {
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.select-option:hover,
.select-option.highlighted {
  background: #f5f5f5;
}

/* Multi-select (citizenship) */
.multi-select {
  position: relative;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  cursor: text;
  margin-top: 6px;
  transition: border-color 0.15s ease;
}

.multi-select:focus-within {
  border-color: #1a1a1a;
}

.multi-select input {
  border: none !important;
  padding: 4px 0 !important;
  min-width: 120px;
  flex: 1;
  font-size: 0.9rem;
}

.multi-select input:focus {
  outline: none;
}

.multi-select-tags {
  display: contents;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.tag-remove {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #888;
  margin-left: 2px;
}

.tag-remove:hover {
  color: #c00;
}

/* Conditional fields */
.conditional {
  display: none;
}

.conditional.visible {
  display: block;
}

/* Navigation buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-prev {
  background: #f5f5f5;
  color: #333;
}

.btn-prev:hover {
  background: #e8e8e8;
}

.btn-next,
.btn-submit {
  background: #1a1a1a;
  color: #fff;
}

.btn-next:hover,
.btn-submit:hover {
  background: #333;
}

.btn-submit {
  padding: 12px 32px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Validation errors */
.field-error {
  border-color: #c00 !important;
}

.error-message {
  color: #c00;
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Confirmation */
.confirmation {
  text-align: center;
  padding: 60px 0;
}

.confirmation.hidden {
  display: none;
}

.confirmation-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.confirmation h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.confirmation p {
  color: #666;
  max-width: 400px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 24px 16px 40px;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  legend {
    font-size: 1.1rem;
  }
}
