/* apply.css — Minimal overrides for the operator application form.
 * Most styling is handled via Tailwind utility classes in the HTML.
 * This file contains only what cannot be expressed with Tailwind utilities.
 */

/* ─── Progress bar ─────────────────────────────────────────────────── */
.form-progress-bar {
  height: 3px;
  background: #38e3ac;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
}

.form-progress-track {
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
}

/* ─── Question transitions ──────────────────────────────────────────── */
.question-container {
  animation: question-enter 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.question-container.leaving {
  animation: question-leave 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes question-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes question-leave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ─── Custom radio buttons ──────────────────────────────────────────── */
.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: #ffffff;
  color: #374151;
  font-size: 1rem;
  line-height: 1.5;
  user-select: none;
  min-height: 52px;
}

.radio-option:hover {
  border-color: rgba(56, 227, 172, 0.6);
  background: rgba(56, 227, 172, 0.04);
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option .radio-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  transition: border-color 0.2s, background-color 0.2s;
  position: relative;
}

.radio-option .radio-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38e3ac;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.radio-option.selected {
  border-color: #38e3ac;
  background: rgba(56, 227, 172, 0.06);
  color: #1a1a2e;
}

.radio-option.selected .radio-indicator {
  border-color: #38e3ac;
}

.radio-option.selected .radio-indicator::after {
  transform: translate(-50%, -50%) scale(1);
}

/* ─── Custom checkboxes (multiselect) ───────────────────────────────── */
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background: #ffffff;
  color: #374151;
  font-size: 1rem;
  line-height: 1.5;
  user-select: none;
  min-height: 52px;
}

.checkbox-option:hover {
  border-color: rgba(56, 227, 172, 0.6);
  background: rgba(56, 227, 172, 0.04);
}

.checkbox-option input[type="checkbox"] {
  display: none;
}

.checkbox-option .checkbox-indicator {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  transition: border-color 0.2s, background-color 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-option .checkbox-indicator::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 9px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg) scale(0) translateY(-1px);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-option.selected {
  border-color: #38e3ac;
  background: rgba(56, 227, 172, 0.06);
  color: #1a1a2e;
}

.checkbox-option.selected .checkbox-indicator {
  border-color: #38e3ac;
  background: #38e3ac;
}

.checkbox-option.selected .checkbox-indicator::after {
  transform: rotate(45deg) scale(1) translateY(-1px);
}

/* ─── Text inputs ───────────────────────────────────────────────────── */
.form-input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  color: #1a1a2e;
  font-size: 1rem;
  font-family: var(--font-body, "DM Sans", system-ui, sans-serif);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  line-height: 1.5;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input:focus {
  border-color: #38e3ac;
  box-shadow: 0 0 0 3px rgba(56, 227, 172, 0.12);
}

.form-input.error {
  border-color: #f87171;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338e3ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 48px;
  cursor: pointer;
}

select.form-input option {
  background: #ffffff;
  color: #1a1a2e;
}

/* ─── Character counter ─────────────────────────────────────────────── */
.char-counter {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: right;
  margin-top: 6px;
  transition: color 0.2s;
}

.char-counter.near-limit {
  color: #d97706;
}

.char-counter.at-limit {
  color: #f87171;
}

/* ─── Error message ─────────────────────────────────────────────────── */
.field-error {
  color: #ef4444;
  font-size: 0.8125rem;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 6px;
}

/* ─── Loading spinner ───────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 227, 172, 0.2);
  border-top-color: #38e3ac;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* ─── Consent checkbox ──────────────────────────────────────────────── */
.consent-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
}

.consent-checkbox-label input[type="checkbox"] {
  display: none;
}

.consent-checkbox-label .custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  margin-top: 2px;
  transition: border-color 0.2s, background-color 0.2s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consent-checkbox-label .custom-checkbox::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 11px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg) scale(0) translateY(-1px);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.consent-checkbox-label:has(input:checked) .custom-checkbox {
  border-color: #38e3ac;
  background: #38e3ac;
}

.consent-checkbox-label:has(input:checked) .custom-checkbox::after {
  transform: rotate(45deg) scale(1) translateY(-1px);
}

/* ─── Success screen ────────────────────────────────────────────────── */
.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(56, 227, 172, 0.1);
  border: 2px solid rgba(56, 227, 172, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  animation: success-pop 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes success-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ─── Block label badge ─────────────────────────────────────────────── */
.block-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 227, 172, 0.1);
  border: 1px solid rgba(56, 227, 172, 0.3);
  color: #16a37a;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Question number badge ─────────────────────────────────────────── */
.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(56, 227, 172, 0.15);
  color: #16a37a;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Searchable select (country picker) ───────────────────────────── */
.ss-wrapper {
  position: relative;
}

.ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  color: #1a1a2e;
  font-size: 1rem;
  font-family: var(--font-body, "DM Sans", system-ui, sans-serif);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ss-trigger:hover {
  border-color: rgba(56, 227, 172, 0.5);
}

.ss-trigger[aria-expanded="true"] {
  border-color: #38e3ac;
  box-shadow: 0 0 0 3px rgba(56, 227, 172, 0.12);
}

.ss-trigger svg {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform 0.2s;
}

.ss-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.ss-placeholder {
  color: #9ca3af;
}

.ss-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 200;
  overflow: hidden;
}

.ss-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  color: #9ca3af;
}

.ss-search {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: #1a1a2e;
  background: transparent;
  font-family: var(--font-body, "DM Sans", system-ui, sans-serif);
}

.ss-search::placeholder {
  color: #9ca3af;
}

.ss-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ss-group {
  padding: 6px 14px 2px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  pointer-events: none;
}

.ss-option {
  padding: 9px 14px;
  font-size: 0.9375rem;
  color: #1a1a2e;
  cursor: pointer;
}

.ss-option:hover {
  background: rgba(56, 227, 172, 0.06);
}

.ss-option--selected {
  background: rgba(56, 227, 172, 0.08);
  color: #16a37a;
  font-weight: 600;
}

.ss-option--hidden {
  display: none;
}

/* ─── Turnstile container ───────────────────────────────────────────── */
.turnstile-wrapper {
  margin-top: 16px;
  min-height: 65px;
}
