/* ============================================================
   KwikDoors — Multi-Step Form Styles
   ============================================================ */

/* ── Form Page Layout ── */
.form-page {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding-top: var(--navbar-height);
  position: relative;
  overflow: hidden;
}

.form-page-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ── Progress Header ── */
.form-progress-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: var(--navbar-height);
  z-index: 50;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.form-progress-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.form-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.form-progress-label {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-progress-step-indicator {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-progress-step-indicator span {
  color: var(--blue-500);
  font-size: 0.95rem;
}

/* Progress Bar */
.progress-bar-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* Step Dots */
.step-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.625rem;
  flex-wrap: wrap;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.step-dot.completed {
  background: var(--blue-500);
  border-color: var(--blue-500);
}

.step-dot.active {
  background: var(--orange-500);
  border-color: var(--orange-500);
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(244,121,32,0.2);
}

/* ── Form Card Container ── */
.form-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Step Panel ── */
.step-panel {
  display: none;
  animation: stepEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step-panel.active { display: block; }

.step-panel.slide-out-left {
  animation: stepExitLeft 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.step-panel.slide-in-right {
  animation: stepEnterRight 0.4s cubic-bezier(0, 0, 0.2, 1) forwards;
}
.step-panel.slide-out-right {
  animation: stepExitRight 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.step-panel.slide-in-left {
  animation: stepEnterLeft 0.4s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes stepEnter {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepExitLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}
@keyframes stepEnterRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepExitRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}
@keyframes stepEnterLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Step Card ── */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

/* Step Header */
.step-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.step-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.step-icon-blue   { background: linear-gradient(135deg, var(--blue-50), var(--blue-100)); color: var(--blue-500); }
.step-icon-orange { background: linear-gradient(135deg, var(--orange-50), #FFE0C2); color: var(--orange-500); }
.step-icon-green  { background: linear-gradient(135deg, #F0FDF4, #DCFCE7); color: #16A34A; }
.step-icon-purple { background: linear-gradient(135deg, #FAF5FF, #EDE9FE); color: #7C3AED; }
.step-icon-pink   { background: linear-gradient(135deg, #FFF1F2, #FFE4E6); color: #E11D48; }

[data-theme="dark"] .step-icon-blue   { background: rgba(30,111,190,0.15); }
[data-theme="dark"] .step-icon-orange { background: rgba(244,121,32,0.12); }
[data-theme="dark"] .step-icon-green  { background: rgba(22,163,74,0.12); }
[data-theme="dark"] .step-icon-purple { background: rgba(124,58,237,0.12); }
[data-theme="dark"] .step-icon-pink   { background: rgba(225,29,72,0.12); }

.step-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--blue-50);
  color: var(--blue-600);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}
[data-theme="dark"] .step-number-badge {
  background: rgba(30,111,190,0.15);
  color: var(--blue-300);
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.step-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Step Body ── */
.step-body { /* form fields go here */ }

/* ── Step Footer / Navigation ── */
.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem;
}

.step-footer-left { flex: 1; }
.step-footer-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-back:hover {
  border-color: var(--gray-400);
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--gradient-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-blue);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30,111,190,0.35);
}

.btn-submit {
  background: var(--gradient-brand);
  box-shadow: 0 4px 20px rgba(244,121,32,0.3);
}

.btn-submit:hover {
  box-shadow: 0 8px 30px rgba(244,121,32,0.4);
}

/* ── Intro / Role Step ── */
.role-intro-card {
  text-align: center;
  padding: 3rem 2rem;
}

.role-intro-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  background: var(--gradient-brand);
  box-shadow: 0 8px 30px rgba(30,111,190,0.3);
}

.role-intro-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.role-intro-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.role-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  text-align: left;
  max-width: 340px;
  margin: 0 auto 2rem;
}

.role-checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.role-checklist-item .check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--orange-500));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

/* ── OTP Step ── */
.otp-container {
  text-align: center;
}

.phone-input-wrapper {
  display: flex;
  gap: 0;
  align-items: stretch;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.phone-input-wrapper:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30,111,190,0.12);
  background: var(--bg-primary);
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.phone-input-wrapper input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.otp-sent-box {
  background: linear-gradient(135deg, var(--blue-50), #EEF4FF);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--blue-700);
}

[data-theme="dark"] .otp-sent-box {
  background: rgba(30,111,190,0.1);
  border-color: rgba(30,111,190,0.2);
  color: var(--blue-300);
}

.otp-inputs {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.otp-digit {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.otp-digit:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30,111,190,0.15);
  background: var(--bg-primary);
}

.otp-digit.filled {
  border-color: var(--orange-500);
  color: var(--orange-600);
}

.otp-resend {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.otp-resend a {
  color: var(--blue-500);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.otp-resend a:hover { color: var(--blue-700); }
.otp-resend a.disabled { color: var(--text-muted); cursor: not-allowed; pointer-events: none; }

#recaptcha-container { margin: 1rem auto; display: flex; justify-content: center; }

/* ── Success Screen ── */
.success-screen {
  text-align: center;
  padding: 3rem 2rem;
  display: none;
}

.success-screen.show { display: block; animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

.success-icon-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22C55E, #16A34A);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 30px rgba(34,197,94,0.35);
  animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 1.875rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.success-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.success-id-box {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Confetti pieces */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  animation: confettiFall 3s ease-in forwards;
  z-index: 999;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Summary Card (shown in success) ── */
.submission-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: left;
  margin-bottom: 1.5rem;
}

.summary-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
}

.summary-item {}
.summary-item-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.summary-item-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Amount Input with ₹ ── */
.amount-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.amount-input-wrap:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30,111,190,0.12);
  background: var(--bg-primary);
}

.amount-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  background: var(--bg-tertiary);
  border-right: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
}

.amount-input-wrap input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

/* ── File Upload ── */
.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-secondary);
  position: relative;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-600);
}

[data-theme="dark"] .file-upload-area:hover,
[data-theme="dark"] .file-upload-area.drag-over {
  background: rgba(30,111,190,0.08);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
  color: var(--blue-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

[data-theme="dark"] .file-upload-icon {
  background: rgba(30,111,190,0.15);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.file-item-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.file-item-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.file-item-remove:hover {
  background: #FEF2F2;
  color: #DC2626;
}

/* ── Range Slider ── */
.range-wrap {
  padding: 0.5rem 0;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.range-value-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  color: var(--blue-700);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.875rem;
}
[data-theme="dark"] .range-value-display {
  background: rgba(30,111,190,0.12);
  border-color: rgba(30,111,190,0.2);
  color: var(--blue-300);
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient-brand);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30,111,190,0.4);
  transition: transform var(--transition-fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .step-card { padding: 1.5rem; }
  .role-intro-card { padding: 2rem 1rem; }
  .otp-digit { width: 44px; height: 52px; font-size: 1.25rem; }
  .summary-grid { grid-template-columns: 1fr; }
  .form-progress-header { position: static; }
}

@media (max-width: 480px) {
  .step-card { padding: 1.25rem; border-radius: var(--radius-lg); }
  .step-footer { flex-direction: column-reverse; }
  .step-footer-right { width: 100%; }
  .btn-next { width: 100%; justify-content: center; }
  .btn-back { width: 100%; justify-content: center; }
  .otp-digit { width: 40px; height: 48px; }
  .success-actions { flex-direction: column; }
  .success-actions .btn { width: 100%; }
}
