/* Import Modern Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Premium Harmonious Light Mode Palette */
  --bg-gradient-start: #f8fafc; /* Slate 50 */
  --bg-gradient-end: #e2e8f0;   /* Slate 200 */
  
  --primary: #10b981;           /* Emerald 500 */
  --primary-glow: rgba(16, 185, 129, 0.15);
  --primary-dark: #059669;
  
  --secondary: #d97706;         /* Amber/Gold 600 */
  --secondary-glow: rgba(217, 119, 6, 0.15);
  
  --text-primary: #0f172a;      /* Slate 900 */
  --text-secondary: #334155;    /* Slate 700 */
  --text-muted: #64748b;        /* Slate 500 */
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-border-focus: rgba(16, 185, 129, 0.4);
  --glass-shadow: rgba(15, 23, 42, 0.08);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Base Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% 50%, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.5;
}

/* Ambient glow blobs in background */
.glow-blob {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-glow) 0%, rgba(16, 185, 129, 0) 70%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
  animation: float-blob 20s infinite ease-in-out alternate;
}

.glow-blob.one {
  top: 10%;
  left: 10%;
}

.glow-blob.two {
  bottom: 10%;
  right: 10%;
  background: radial-gradient(circle, var(--secondary-glow) 0%, rgba(245, 158, 11, 0) 70%);
  animation-delay: -10s;
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.2); }
}

/* -------------------------------------------------------------
   SPLASH SCREEN (Falling Money Notes)
   ------------------------------------------------------------- */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff; /* User explicitly asked for a white background */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
  overflow: hidden;
}

#money-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.splash-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Logo brand on splash screen */
.brand-logo-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-wrapper {
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border-radius: 24px;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 2px solid rgba(16, 185, 129, 0.15);
  margin-bottom: 10px;
  animation: pulse-icon 2s infinite ease-in-out;
}

.brand-icon-wrapper svg {
  width: 48px;
  height: 48px;
  fill: #10b981;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.brand-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: -5px;
}

/* Beautiful loading bar */
.loader-bar {
  width: 160px;
  height: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: 15px;
}

.loader-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  border-radius: 10px;
  animation: loading-fill 3.5s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

@keyframes loading-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes pulse-icon {
  0% { transform: scale(1); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15); }
  50% { transform: scale(1.05); box-shadow: 0 15px 35px rgba(16, 185, 129, 0.25); border-color: rgba(16, 185, 129, 0.5); }
  100% { transform: scale(1); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15); }
}

/* -------------------------------------------------------------
   MAIN CONTAINER & CARD (Responsive Lead Page)
   ------------------------------------------------------------- */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 24px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

main.visible {
  opacity: 1;
  transform: translateY(0);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 55%
  );
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 1;
}

/* Card Header styles */
.card-header {
  text-align: center;
  margin-bottom: 35px;
}

.logo-icon-small {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.logo-icon-small svg {
  width: 28px;
  height: 28px;
  fill: var(--primary);
}

.card-header h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* -------------------------------------------------------------
   FORM STYLES & FLOATING LABELS
   ------------------------------------------------------------- */
.form-group {
  position: relative;
  margin-bottom: 24px;
}

.input-icon-wrapper {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-smooth);
  z-index: 2;
}

.input-icon-wrapper svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.form-control {
  width: 100%;
  padding: 16px 16px 16px 48px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Focus effects on icon */
.form-control:focus ~ .input-icon-wrapper {
  color: var(--primary);
}

/* Custom Floating Label */
.form-label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: var(--transition-smooth);
  background: transparent;
}

/* Float logic */
.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
  top: 0;
  left: 16px;
  font-size: 0.75rem;
  color: var(--primary);
  background: #ffffff; /* matches solid light input background */
  padding: 2px 8px;
  border-radius: 6px;
  transform: translateY(-50%);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.form-control:not(:placeholder-shown):not(:focus) ~ .form-label {
  color: var(--text-secondary);
}

/* Button & Actions */
.btn-submit {
  width: 100%;
  padding: 16px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(90deg, var(--primary), #34d399);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 20px -10px var(--primary-glow);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -8px var(--primary-glow);
}

.btn-submit:active {
  transform: translateY(1px);
}

.btn-submit svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.btn-submit:hover svg {
  transform: translateX(4px);
}

.card-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   SUCCESS MODAL & COUNTDOWN REDIRECT
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 24px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.success-modal {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 25px 50px -12px var(--glass-shadow);
  transform: scale(0.9);
  transition: var(--transition-bounce);
}

.modal-overlay.active .success-modal {
  transform: scale(1);
}

/* Checkmark animation */
.success-icon-wrapper {
  width: 76px;
  height: 76px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  border: 2px solid var(--primary);
  animation: scaleUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-icon-wrapper svg {
  width: 40px;
  height: 40px;
  fill: var(--primary);
}

.success-modal h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-modal p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* Generated URM Number Card */
.lead-id-container {
  background: rgba(16, 185, 129, 0.04);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 25px;
}

.lead-id-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.lead-id-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

/* Countdown Redirection text */
.redirect-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.countdown-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

@keyframes scaleUp {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* -------------------------------------------------------------
   RESPONSIVENESS (Small/Medium/Large Screen Adjustments)
   ------------------------------------------------------------- */
@media (max-width: 480px) {
  main {
    padding: 16px;
  }
  
  .glass-card {
    padding: 30px 20px;
    border-radius: 24px;
  }
  
  .card-header h1 {
    font-size: 1.6rem;
  }
  
  .brand-title {
    font-size: 1.8rem;
  }
  
  .brand-icon-wrapper {
    width: 80px;
    height: 80px;
  }
  
  .success-modal {
    padding: 30px 20px;
  }
}

@media (min-width: 1200px) {
  main {
    max-width: 520px;
  }
}
