/* Enhanced API Loader Styles */
#api-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.loader-overlay {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-xl);
  max-width: 350px;
  width: 90%;
  position: relative;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loader-content p {
  color: var(--text-white);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
}

.loader-spinner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Simple & Elegant Popup Styles */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}

.popup-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: popIn 0.3s ease-out;
  text-align: center;
  position: relative;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.popup-header h2 {
  margin: 0 0 1rem 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #1f2937;
}

.popup-body {
  margin-bottom: 2rem;
}

.popup-body p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: #6b7280;
}

.popup-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  outline: none;
}

.popup-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.popup-btn:active {
  transform: translateY(0);
}

/* Error Popup Styles */
.error-popup .popup-header h2 {
  color: #dc2626;
}

.error-popup .popup-header h2::before {
  content: "❌";
  font-size: 1.2em;
  margin-right: 0.5rem;
}

/* POSinity Request Demo - Optimized Design */
:root {
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --primary-light: #ef4444;
  --primary-glow: rgba(220, 38, 38, 0.3);
  --bg-dark: #0a0a0a;
  --bg-card: #111111;
  --bg-surface: #1a1a1a;
  --text-white: #ffffff;
  --text-gray: #a0a0a0;
  --text-light: #e0e0e0;
  --border: #2a2a2a;
  --border-light: #3a3a3a;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.3);
  --glow: 0 0 20px rgba(220, 38, 38, 0.4);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: auto;
}

body {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a1a 50%, var(--bg-dark) 100%);
  color: var(--text-white);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 2rem 1rem;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(239, 68, 68, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Main Container */
.container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  overflow: hidden;
  min-height: 600px;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scan 2s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-white);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--glow);
}

/* Modern Progress Stepper */
.progress {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem 1rem;
  gap: 0.75rem;
  position: relative;
  flex-shrink: 0;
  width: 100%;
}

.progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 1;
}

.step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-gray);
  background: var(--bg-card);
  transition: var(--transition);
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.step::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: var(--transition);
  z-index: -1;
}

.step.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--glow);
  transform: scale(1.1);
}

.step.active::before {
  opacity: 0.3;
}

.step.completed {
  border-color: var(--primary);
  color: var(--text-white);
  background: var(--primary);
  box-shadow: var(--glow);
}

.step.completed::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  font-weight: bold;
}

.line {
  position: absolute;
  top: 50%;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 1;
  overflow: hidden;
}

.line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  width: 0%;
  transition: width 0.5s ease;
}

.step.completed + .line::after {
  width: 100%;
}

/* Step Content */
.step-section {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem 2rem 2rem;
  text-align: center;
  animation: slideIn 0.4s ease;
  overflow-y: auto;
  min-height: 0;
  width: 100%;
}

.step-section.active {
  display: flex !important;
}

/* Removed conflicting CSS rule that was showing all sections */

/* Ensure proper alignment for all step content */
.step-section h1,
.step-section .subtitle,
.step-section .options,
.step-section .options-grid,
.step-section #final-form,
.step-section .step-nav,
.step-section .form-footer,
.step-section .why-ask {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-white);
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text-white) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-gray);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  max-width: 600px;
}

/* Step Icon - Hidden */
.step-icon {
  display: none;
}

/* Options */
.options {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 600px;
}

.option {
  flex: 1;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1rem;
  color: var(--text-white);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(108, 71, 255, 0.1), transparent);
  transition: left 0.5s;
}

.option:hover::before {
  left: 100%;
}

.option:hover {
  border-color: var(--primary);
  background: rgba(108, 71, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--text-white);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.icon {
  font-size: 1.5rem;
  transition: var(--transition);
}

.icon svg {
  width: 24px;
  height: 24px;
}

.option:hover .icon,
.option.selected .icon {
  transform: scale(1.1);
}

/* Grid Options - Better responsive grid for business types and revenue */
.options-grid,
#business-type-options,
#revenue-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 600px;
}

.options-grid .option,
#business-type-options .option,
#revenue-options .option {
  padding: 1rem 0.75rem;
  font-size: 0.875rem;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.options-grid .icon,
#business-type-options .icon,
#revenue-options .icon {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.options-grid .icon svg,
#business-type-options .icon svg,
#revenue-options .icon svg {
  width: 20px;
  height: 20px;
}

/* Navigation */
.step-nav {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  margin-top: auto;
  padding-top: 1rem;
}

.prev-btn {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-gray);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  backdrop-filter: blur(10px);
}

.prev-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 71, 255, 0.05);
}

.next-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
  color: var(--text-white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex: 2;
  position: relative;
  overflow: hidden;
}

.next-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.next-btn:hover::before {
  left: 100%;
}

.next-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.next-btn:disabled {
  background: var(--border);
  color: var(--text-gray);
  cursor: not-allowed;
  transform: none;
}

/* Form */
#final-form {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#final-form input[type="text"],
#final-form input[type="email"],
#final-form input[type="tel"],
#final-form input[type="password"] {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  color: var(--text-white);
  font-size: 0.95rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

#final-form input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(108, 71, 255, 0.05);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

#final-form input::placeholder {
  color: var(--text-gray);
}

/* Phone Row */
.phone-row {
  display: flex;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  backdrop-filter: blur(10px);
}

.phone-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.phone-row select {
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  cursor: pointer;
  min-width: 120px;
}

.phone-row select option {
  background: var(--bg-card);
  color: var(--text-white);
}

.phone-row input[type="tel"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 0.95rem;
  padding: 0.25rem 0;
}

/* Checkbox */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-gray);
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
  padding: 0.875rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.checkbox-row:hover {
  border-color: var(--primary);
  background: rgba(108, 71, 255, 0.05);
}

.checkbox-row input[type="checkbox"] {
  margin-top: 0.125rem;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Form Submit */
#final-form .next-btn[type="submit"] {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

/* Form Footer */
.form-footer {
  color: var(--text-gray);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.4;
  max-width: 600px;
  padding: 0.875rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.form-footer a {
  color: var(--primary);
  text-decoration: underline;
  transition: var(--transition);
}

.form-footer a:hover {
  color: var(--primary-light);
}

/* Why Ask */
.why-ask {
  color: var(--text-gray);
  font-size: 0.85rem;
  text-align: center;
  max-width: 600px;
  line-height: 1.4;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.why-ask strong {
  color: var(--text-white);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  .container {
    max-width: 100%;
  }
  
  .step-section {
    padding: 1rem 1.5rem 1.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .options {
    flex-direction: column;
  }
  
  .options-grid,
  #business-type-options,
  #revenue-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .step-nav {
    flex-direction: column;
  }
  
  .prev-btn {
    order: 2;
  }
  
  .next-btn {
    order: 1;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }
  
  .container {
    border-radius: var(--radius-sm);
  }
  
  .step-section {
    padding: 1rem 1rem 1.5rem;
  }
  
  .options-grid,
  #business-type-options,
  #revenue-options {
    grid-template-columns: 1fr;
  }
}

/* Error styles */
.form-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  animation: shake 0.4s ease;
  padding: 0.5rem;
  background: rgba(255, 107, 107, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Toast */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow);
  animation: slideDown 0.4s ease;
  backdrop-filter: blur(10px);
  border: 1px solid var(--primary);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Password Section Styles */
.password-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
  backdrop-filter: blur(10px);
}

.password-requirements {
  margin-top: 0.5rem;
}

.password-requirements small {
  color: var(--text-gray);
  font-size: 0.8rem;
  line-height: 1.4;
  display: block;
}

/* Password field validation styles */
.password-section input[type="password"] {
  margin-bottom: 0;
}

.password-section input[type="password"].valid {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.password-section input[type="password"].invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.password-match-indicator {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.password-match-indicator.match {
  color: #10b981;
}

.password-match-indicator.no-match {
  color: #ef4444;
}

/* Trial mode styles */
.trial-mode #submit-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2px solid #10b981;
}

.trial-mode #submit-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #059669;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
} 