/* ============================================
   AltVFX Employee Onboarding Portal
   Dark theme · Professional · Clean
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-input: #1c1c28;
  --bg-hover: #22222e;
  --border: #2a2a3a;
  --border-focus: #00b4d8;
  --accent: #00b4d8;
  --accent-dim: rgba(0, 180, 216, 0.15);
  --accent-glow: rgba(0, 180, 216, 0.3);
  --text-primary: #f0f0f5;
  --text-secondary: #9898a8;
  --text-muted: #6a6a7a;
  --error: #ff4d6a;
  --error-bg: rgba(255, 77, 106, 0.1);
  --success: #00d89b;
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.logo-accent {
  color: var(--accent);
}

.header-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ---- Progress ---- */
.progress-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

#stepLabel {
  color: var(--accent);
  font-weight: 600;
}

#stepTitle {
  color: var(--text-secondary);
  font-weight: 400;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0096c7);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.progress-dot {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  transition: background var(--transition);
}

.progress-dot.active {
  background: var(--accent);
}

.progress-dot.completed {
  background: var(--accent);
  opacity: 0.5;
}

/* ---- Main ---- */
.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 24px 48px;
}

.form-container {
  max-width: 800px;
  width: 100%;
}

/* ---- Step ---- */
.step {
  animation: fadeIn 0.3s ease;
}

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

.step-heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.subsection-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 28px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 20px;
  flex: 1;
}

.form-group-sm {
  max-width: 160px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.required-mark {
  color: var(--accent);
  font-weight: 600;
}

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

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='%239898a8' stroke-width='2'%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;
}

input:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input.invalid,
select.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

input::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.readonly-field {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary) !important;
}

.access-state {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.access-state.error {
  border-color: rgba(255, 107, 107, 0.4);
  color: #ffb4b4;
}

.error-msg {
  display: none;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}

.error-msg.visible {
  display: block;
}

/* ---- Form Rows ---- */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row-2 > .form-group {
  flex: 1;
}

.form-row-3 > .form-group {
  flex: 1;
}

/* ---- Radio Buttons ---- */
.radio-group {
  display: flex;
  gap: 20px;
  padding-top: 4px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-primary);
}

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

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition);
  flex-shrink: 0;
}

.radio-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.15s ease;
}

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

.radio-label input[type="radio"]:checked + .radio-custom::after {
  transform: scale(1);
}

/* ---- File Upload ---- */
.file-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}

.file-upload:hover,
.file-upload.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.file-upload.disabled,
.file-upload.disabled:hover {
  cursor: not-allowed;
  border-color: var(--border);
  background: transparent;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border: none !important;
}

.file-upload.disabled .file-input {
  cursor: not-allowed;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  pointer-events: none;
}

.file-upload-label svg {
  color: var(--accent);
}

.file-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-selected {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 500;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition);
  position: relative;
  z-index: 2;
}

.file-remove:hover {
  color: var(--error);
}

/* ---- Info Banner ---- */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 180, 216, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.info-banner svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- Visa Section ---- */
.visa-section {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 600px; }
}

/* ---- Summary / Confirmation ---- */
.summary-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.summary-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.summary-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.summary-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.summary-item:last-child,
.summary-item:nth-last-child(2):nth-child(odd) + .summary-item {
  border-bottom: none;
}

.summary-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

.summary-value.empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ---- Navigation Buttons ---- */
.nav-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.nav-spacer {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #00c8f0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-submit {
  background: linear-gradient(135deg, var(--accent), #0096c7);
  color: #000;
  font-weight: 600;
  padding: 14px 36px;
  font-size: 1rem;
}

.btn-submit:hover {
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-1px);
}

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

/* ---- Success Screen ---- */
.success-screen {
  text-align: center;
  padding: 60px 20px;
  animation: fadeIn 0.5s ease;
}

.success-icon {
  margin-bottom: 24px;
}

.success-screen h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.success-screen p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 8px;
}

.submission-id {
  margin-top: 20px !important;
}

.submission-id code {
  color: var(--accent);
  background: var(--bg-input);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.success-note {
  margin-top: 16px !important;
  font-size: 0.9rem !important;
  color: var(--text-muted) !important;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 20px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .form-row,
  .form-row-2,
  .form-row-3 {
    flex-direction: column;
    gap: 0;
  }

  .form-group-sm {
    max-width: 100%;
  }

  .step-heading {
    font-size: 1.3rem;
  }

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

  .nav-buttons {
    flex-wrap: wrap;
  }

  .btn {
    padding: 12px 20px;
  }

  .header-label {
    display: none;
  }

  .progress-container {
    padding-top: 20px;
  }
}

@media (max-width: 400px) {
  .main {
    padding: 20px 16px 40px;
  }

  .progress-container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---- Loading State ---- */
.btn.loading {
  pointer-events: none;
  position: relative;
}

.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 4px;
}

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