/* ================================================
   ASTREVO ONBOARDING — Design System
   Dark purple theme inspired by reference images
   ================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #0a0118;
  --bg-card: rgba(20, 8, 42, 0.65);
  --bg-card-hover: rgba(30, 12, 60, 0.8);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-input-focus: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(138, 83, 255, 0.5);
  --text-primary: #f0eaf8;
  --text-secondary: rgba(200, 180, 230, 0.7);
  --text-muted: rgba(180, 160, 210, 0.5);
  --accent: #8a53ff;
  --accent-hover: #9d6fff;
  --accent-glow: rgba(138, 83, 255, 0.35);
  --danger: #ff5c73;
  --success: #53ffa8;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Ambient Glows --- */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: rgba(100, 40, 200, 0.18);
  top: -100px;
  right: -150px;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: rgba(138, 83, 255, 0.12);
  bottom: -100px;
  left: -100px;
}

.glow-3 {
  width: 300px;
  height: 300px;
  background: rgba(160, 60, 255, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* --- Screens --- */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Welcome Screen --- */
.welcome-container {
  max-width: 560px;
  margin: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
}

.welcome-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138, 83, 255, 0.4), transparent);
  margin-bottom: 2.5rem;
}

.welcome-container h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.welcome-container .btn {
  align-self: flex-start;
}

/* --- Top Bar --- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 1, 24, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.top-bar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Progress Bar --- */
.progress-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #c084fc);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--accent-glow);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  gap: 0.25rem;
}

.progress-step {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  flex: 1;
  transition: color var(--transition);
  cursor: pointer;
  padding: 0.25rem 0;
}

.progress-step.active {
  color: var(--accent);
  font-weight: 600;
}

.progress-step.completed {
  color: var(--text-secondary);
}

/* --- Form Container --- */
.form-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 6rem;
}

/* --- Steps --- */
.step {
  display: none;
  animation: stepIn 0.4s ease;
}

.step.active {
  display: block;
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-title {
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* --- Form Elements --- */
.field-group {
  margin-bottom: 1.25rem;
}

.label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.required {
  color: var(--accent);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -0.75rem;
  margin-bottom: 1rem;
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(138, 83, 255, 0.1);
}

.input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 92, 115, 0.1);
}

.input-sm {
  max-width: 200px;
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

.select {
  appearance: none;
  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='%238a53ff' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select option {
  background: #1a0a30;
  color: var(--text-primary);
}

/* Field rows */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* --- Toggle --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toggle-row .label {
  margin-bottom: 0;
  flex: 1;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked+.toggle-slider {
  background: var(--accent);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

/* --- Radio & Checkbox Cards --- */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.checkbox-group.vertical {
  flex-direction: column;
}

.radio-card,
.checkbox-card {
  position: relative;
  cursor: pointer;
}

.radio-card input,
.checkbox-card input {
  position: absolute;
  opacity: 0;
}

.radio-card-inner,
.checkbox-card span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.radio-card input:checked~.radio-card-inner,
.checkbox-card input:checked~span {
  border-color: var(--accent);
  background: rgba(138, 83, 255, 0.12);
  color: var(--text-primary);
}

.radio-card:hover .radio-card-inner,
.checkbox-card:hover span {
  border-color: rgba(138, 83, 255, 0.3);
  background: rgba(138, 83, 255, 0.06);
}

.confirm-checkbox span {
  font-weight: 500;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 25px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px dashed rgba(138, 83, 255, 0.3);
}

.btn-outline:hover {
  background: rgba(138, 83, 255, 0.08);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-large {
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
}

.btn-add {
  width: 100%;
  justify-content: center;
  padding: 0.8rem;
  margin-top: 0.5rem;
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.btn-remove:hover {
  color: var(--danger);
  background: rgba(255, 92, 115, 0.1);
}

/* --- Dynamic cards (professionals, procedures, FAQs) --- */
.dynamic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  animation: cardIn 0.3s ease;
  position: relative;
}

.dynamic-card:hover {
  border-color: rgba(138, 83, 255, 0.15);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* Procedures section inside professional card */
.procedures-section {
  margin-top: 0.5rem;
}

.procedures-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.procedure-subcard {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
  animation: cardIn 0.3s ease;
}

.procedure-subcard:hover {
  border-color: rgba(138, 83, 255, 0.12);
}

.subcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.subcard-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.btn-remove-sub {
  padding: 0.2rem;
}

.btn-add-proc-inner {
  font-size: 0.8rem;
  padding: 0.6rem;
  border-style: dashed;
}

/* Days checkboxes */
.days-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.day-chip {
  position: relative;
  cursor: pointer;
}

.day-chip input {
  position: absolute;
  opacity: 0;
}

.day-chip span {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.day-chip input:checked~span {
  background: rgba(138, 83, 255, 0.15);
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Business hours row */
.hour-row {
  display: grid;
  grid-template-columns: 100px auto 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.hour-row:last-child {
  border-bottom: none;
}

.hour-day {
  font-size: 0.85rem;
  font-weight: 500;
}

.hour-row .input {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

@media (max-width: 520px) {
  .hour-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .hour-day {
    grid-column: 1;
  }

  .hour-row .toggle {
    grid-column: 2;
    justify-self: end;
  }
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 1.5rem 0;
}

/* Conditional fields */
.conditional-fields {
  padding-left: 0;
  margin-bottom: 1rem;
  animation: fadeIn 0.3s ease;
}

/* --- Form Navigation --- */
.form-nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 1, 24, 0.85);
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

/* --- Review Section --- */
.review-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.review-section:hover {
  border-color: rgba(138, 83, 255, 0.3);
  background: var(--bg-card-hover);
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.review-section-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

.review-section-header .edit-icon {
  color: var(--text-muted);
  transition: color var(--transition);
}

.review-section:hover .edit-icon {
  color: var(--accent);
}

.review-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.review-item .review-label {
  color: var(--text-muted);
  min-width: 120px;
  flex-shrink: 0;
}

.review-item .review-value {
  color: var(--text-primary);
  word-break: break-word;
}

/* --- Success Screen --- */
.success-container {
  max-width: 500px;
  margin: auto;
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.success-line {
  width: 100%;
  max-width: 400px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin-bottom: 2rem;
}

.success-thanks {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 40px var(--accent-glow);
  animation: pulseIcon 2s ease infinite;
}

.success-icon svg {
  stroke: white;
}

.error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 92, 115, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.error-icon svg {
  stroke: var(--danger);
}

@keyframes pulseIcon {

  0%,
  100% {
    box-shadow: 0 0 30px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 60px var(--accent-glow), 0 0 80px rgba(138, 83, 255, 0.15);
  }
}

.success-container h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.success-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 1, 24, 0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.loading-overlay p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(138, 83, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  backdrop-filter: blur(20px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.toast-success {
  border-color: rgba(83, 255, 168, 0.3);
}

/* --- Pricing procedure row --- */
.pricing-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.pricing-row:last-child {
  border-bottom: none;
}

.pricing-name {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.pricing-row .input {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .pricing-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .glow-1 {
    width: 300px;
    height: 300px;
  }

  .glow-2 {
    width: 250px;
    height: 250px;
  }

  .glow-3 {
    width: 200px;
    height: 200px;
  }

  .form-container {
    padding-bottom: 7rem;
  }
}

@media (max-width: 480px) {
  .top-bar-inner {
    padding: 0.6rem 1rem;
  }

  .progress-wrapper {
    padding: 1rem 1rem 0;
  }

  .form-container {
    padding: 1rem 1rem 7rem;
  }

  .form-nav {
    padding: 0.75rem 1rem 1.5rem;
  }

  .progress-step {
    font-size: 0.6rem;
  }

  .review-item {
    flex-direction: column;
    gap: 0.15rem;
  }

  .review-item .review-label {
    min-width: auto;
  }
}

/* Validation error msg */
.error-msg {
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 0.3rem;
  display: none;
}

.field-group.has-error .error-msg {
  display: block;
}

.field-group.has-error .input {
  border-color: var(--danger);
}

/* Scroll fix for progress step clicks */
html {
  scroll-padding-top: 80px;
}