/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Light theme with purple accents - matching Phazee logo */
  --color-bg: #f8f7fc;
  --color-surface: #ffffff;
  --color-surface-elevated: #faf9fe;
  --color-border: #e8e5f2;
  --color-border-focus: #7c6bb5;
  --color-text-primary: #1a1625;
  --color-text-secondary: #5c5470;
  --color-text-muted: #8b839e;
  --color-accent: #7c6bb5;
  --color-accent-light: #9d8fd1;
  --color-accent-dark: #5d4e8c;
  --color-accent-hover: #8b7bc4;
  --color-accent-glow: rgba(124, 107, 181, 0.2);
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-heart: #e74c8c;
  --color-heart-glow: rgba(231, 76, 140, 0.3);
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-soft: 0 4px 24px rgba(124, 107, 181, 0.08);
  --shadow-medium: 0 8px 40px rgba(124, 107, 181, 0.12);
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

/* Page Layout */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Widget Container */
.widget-container {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-medium);
}

/* Widget Header */
.widget-header {
  text-align: center;
  margin-bottom: 24px;
}

.logo-container {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.widget-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.widget-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  font-weight: 500;
}

/* Counter Row - Single Line */
.counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.counter-heart {
  width: 24px;
  height: 24px;
  color: var(--color-heart);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.counter-heart svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 6px var(--color-heart-glow));
  transition: transform 0.1s ease;
}

.counter-heart.beating svg {
  animation: heartbeat 0.8s ease-in-out;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  15% { transform: scale(1.4); }
  30% { transform: scale(1); }
  45% { transform: scale(1.3); }
  60% { transform: scale(1); }
  75% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.counter-number {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  transition: transform 0.2s ease;
}

.counter-number.bump {
  animation: numberBump 0.3s ease;
}

@keyframes numberBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); color: var(--color-heart); }
  100% { transform: scale(1); }
}

.counter-label {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Form */
.widget-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget-form.hidden {
  display: none;
}

/* Honeypot - hidden from real users */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-label .required {
  color: var(--color-accent);
}

.form-label .optional {
  color: var(--color-text-muted);
  font-weight: 500;
}

.form-input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-primary);
  background: var(--color-surface-elevated);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: 
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
  outline: none;
}

.form-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.form-input:hover {
  border-color: #d4cfe6;
  background: var(--color-surface);
}

.form-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px rgba(124, 107, 181, 0.12);
  background: var(--color-surface);
}

/* Submit Button */
.submit-btn {
  width: 100%;
  height: 56px;
  margin-top: 8px;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: 
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(124, 107, 181, 0.3);
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124, 107, 181, 0.4);
}

.submit-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-text,
.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-loading {
  display: none;
}

.submit-btn.loading .btn-text {
  display: none;
}

.submit-btn.loading .btn-loading {
  display: flex;
}

.spinner {
  animation: spin 1s linear infinite;
}

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

/* Privacy Text */
.privacy-text {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 8px;
  transition: opacity 0.3s ease;
}

.privacy-text.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Success Message */
.success-message {
  text-align: center;
  padding: 20px 0 0;
}

.success-message[hidden] {
  display: none;
}

.success-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 12px 16px;
  background: var(--color-error-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--color-error);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 16px;
}

.error-message[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 480px) {
  .widget-container {
    padding: 32px 24px;
    border-radius: var(--radius-md);
  }
  
  .widget-title {
    font-size: 1.625rem;
  }
  
  .logo-container {
    width: 64px;
    height: 64px;
  }
  
  .form-input,
  .submit-btn {
    height: 50px;
  }
  
  .counter-row {
    gap: 6px;
  }
  
  .counter-number {
    font-size: 1rem;
  }
  
  .counter-label {
    font-size: 0.875rem;
  }
}

/* Focus visible for accessibility */
.form-input:focus-visible,
.submit-btn:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Shake animation for validation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
