/* ============================================
   Pawfect Moment - Custom Form Styles
   Mobile-first, pixel-perfect Typeform clone
   ============================================ */

/* CSS Variables */
:root {
  color-scheme: light only;
  --color-primary: #F38181;
  --color-primary-hover: #E06B6B;
  --color-text: #1A1A1A;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-bg-light: rgba(255, 255, 255, 0.3);
  --color-input-border: #CCCCCC;
  --color-input-focus: #F38181;
  --color-success: #4CAF50;
  --color-error: #F44336;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

/* Initial Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #B5E0E8 0%, #FFDAB3 50%, #B5E0E8 100%);
  background-image: url('https://submit.thepawfectmoment.com/submit-dog-calendar/assets/background.jpg');
  background-size: cover;
  background-position: center;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loading-logo {
  width: 200px;
  height: auto;
}

@media (min-width: 768px) {
  .loading-logo {
    width: 280px;
  }
}

.loading-bar-container {
  width: 200px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .loading-bar-container {
    width: 280px;
  }
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: #1A1A1A;
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  line-height: 1.5;
  background: linear-gradient(135deg, #B5E0E8 0%, #FFDAB3 50%, #B5E0E8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* If background image is provided, use it */
body.has-bg-image {
  background-image: url('https://submit.thepawfectmoment.com/submit-dog-calendar/assets/background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Logo Styles */
.logo-container {
  margin-bottom: var(--spacing-xl);
}

.welcome-logo {
  max-width: 280px;
  height: auto;
  margin: 0 auto;
  display: block;
}

@media (min-width: 768px) {
  .welcome-logo {
    max-width: 350px;
  }
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.progress-fill {
  height: 100%;
  background: #000;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Form Container */
.form-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  padding-bottom: var(--spacing-xl);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Steps */
.step {
  display: none;
  width: 100%;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Direction-aware entering states */
.step.entering-forward {
  display: block;
  opacity: 0;
  transform: translate3d(0, 60px, 0);
}

.step.entering-backward {
  display: block;
  opacity: 0;
  transform: translate3d(0, -60px, 0);
}

.step.active {
  display: block;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Direction-aware exiting states (position: absolute to avoid layout shift during overlap) */
.step.exiting-forward {
  display: block;
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translate3d(0, -50px, 0) scale(0.97);
}

.step.exiting-backward {
  display: block;
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translate3d(0, 50px, 0) scale(0.97);
}

/* Staggered children entrance */
.step.active .step-content > * {
  animation: stepChildIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.step.active .step-content > *:nth-child(1) { animation-delay: 0.03s; }
.step.active .step-content > *:nth-child(2) { animation-delay: 0.07s; }
.step.active .step-content > *:nth-child(3) { animation-delay: 0.11s; }
.step.active .step-content > *:nth-child(4) { animation-delay: 0.15s; }
.step.active .step-content > *:nth-child(5) { animation-delay: 0.19s; }
.step.active .step-content > *:nth-child(6) { animation-delay: 0.23s; }

@keyframes stepChildIn {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.step-content {
  width: 100%;
}

/* Welcome Screen */
.welcome-content {
  text-align: center;
}

.welcome-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--spacing-lg);
}

.welcome-subtitle {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--spacing-xl);
}

.btn-start {
  width: 100%;
  max-width: 340px;
  min-height: 56px; /* Hero CTA — larger for prominence + thumb comfort */
  font-size: 1.25rem;
  padding: var(--spacing-md) var(--spacing-2xl);
  letter-spacing: 0.3px;
}

.social-proof {
  margin-top: var(--spacing-md);
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* Question Header */
.question-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.question-text {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
}

.question-text .emoji {
  margin-left: var(--spacing-xs);
}

.question-text .required {
  color: var(--color-primary);
  margin-left: 2px;
}

.question-description {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.question-description.links a {
  color: var(--color-text);
  text-decoration: underline;
}

.quote-mark {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}

.info-title {
  margin-left: 0;
}

/* Text Inputs */
.text-input {
  width: 100%;
  font-family: inherit;
  font-size: 1.25rem;
  padding: var(--spacing-sm) 0;
  border: none;
  border-bottom: 2px solid var(--color-input-border);
  background: transparent;
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast);
}

.text-input::placeholder {
  color: var(--color-text-muted);
}

.text-input:focus {
  border-bottom-color: var(--color-input-focus);
}

/* Date Inputs */
.date-inputs {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date-field label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-input {
  width: 60px;
  font-family: inherit;
  font-size: 1.25rem;
  padding: var(--spacing-xs) 0;
  border: none;
  border-bottom: 2px solid var(--color-input-border);
  background: transparent;
  color: var(--color-text);
  outline: none;
  text-align: center;
  transition: border-color var(--transition-fast);
}

.date-input-year {
  width: 80px;
}

.date-input:focus {
  border-bottom-color: var(--color-input-focus);
}

.date-separator {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  padding-bottom: var(--spacing-xs);
}

/* Phone Input */
.phone-input-wrapper {
  display: flex;
  align-items: stretch;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-input-border);
  transition: border-color var(--transition-fast);
  position: relative;
  z-index: 500;
}

.phone-input-wrapper:focus-within {
  border-bottom-color: var(--color-input-focus);
}

.country-selector {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 0;
  cursor: pointer;
  user-select: none;
  position: relative;
  flex-shrink: 0;
}

.country-selector .flag {
  font-size: 1.5rem;
}

.country-selector .dropdown-arrow {
  font-size: 0.625rem;
  color: var(--color-text-muted);
}

.phone-input {
  flex: 1;
  border-bottom: none !important;
  margin-bottom: 0;
}

.phone-input:focus {
  border-bottom-color: transparent !important;
}

/* Country Dropdown */
.country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-height: 240px;
  overflow-y: auto;
  min-width: 220px;
  padding: 4px 0;
  display: none;
}

.country-dropdown.open {
  display: block;
}

.country-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #333;
  transition: background 0.15s;
}

.country-dropdown-item:hover {
  background: #f0f7f9;
}

.country-dropdown-item.selected {
  background: #e8f4f7;
  font-weight: 600;
}

.country-dropdown-item .country-flag {
  font-size: 1.25rem;
}

.country-dropdown-item .country-dial {
  color: #888;
  margin-left: auto;
}

/* Choice Buttons (Yes/No) */
.choice-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.btn-choice {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 340px;
  min-height: 56px; /* Generous touch target for binary choices */
  padding: var(--spacing-md) var(--spacing-lg);
  background: transparent;
  border: 2px solid var(--color-input-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.0625rem;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-choice:hover {
  border-color: var(--color-text);
}

.btn-choice.selected {
  border-color: var(--color-text);
  background: rgba(0, 0, 0, 0.05);
}

.choice-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-sm);
}

.choice-label {
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: var(--spacing-md) var(--spacing-lg); /* 16px 24px — comfortable thumb padding */
  min-height: 48px; /* Fitts's Law: ≥44px touch target */
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: scale(1.02);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-input-border);
}

.btn-secondary:hover {
  border-color: var(--color-text);
}

.btn-text {
  background: transparent;
  color: var(--color-text-light);
  padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-text:hover {
  color: var(--color-text);
}

.btn-ok {
  margin-top: var(--spacing-lg);
  margin-bottom: 140px;
  width: calc(100% - 70px);
  max-width: 300px;
  min-height: 52px; /* Comfortably thumb-tappable */
  font-size: 1.0625rem;
}

.btn-continue {
  width: 100%;
  max-width: 300px;
  min-height: 52px;
  font-size: 1.0625rem;
}

.hint {
  display: block;
  margin-top: var(--spacing-sm);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* SMS consent section — no background, transparent */
.sms-consent-options,
.sms-consent-label {
  background: none !important;
  -webkit-appearance: none;
}

/* SMS consent checkboxes — enlarge for touch */
.sms-consent-label input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
}

/* Upload Zone */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl);
  border: 2px dashed var(--color-input-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-lg);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--color-primary);
  background: rgba(243, 129, 129, 0.1);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--color-success);
}

.upload-zone.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.upload-icon {
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.upload-text {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
}

.upload-limit {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-sm);
}

/* Calendar Preview Frame - matches template aspect ratio (3375x2625) */
.calendar-preview-frame {
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  width: 260px;
  aspect-ratio: 3375 / 2625;
}

.calendar-preview-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
}

/* Sidebar mimicking the calendar template */
.calendar-preview-sidebar {
  width: 12%;
  height: 100%;
  background: linear-gradient(180deg, #7B68B0 0%, #6B5A9E 100%);
  flex-shrink: 0;
  position: relative;
}

/* Main photo (fills remaining space after sidebar) */
.calendar-preview-image {
  flex: 1;
  width: 88%;
  height: 100%;
  object-fit: cover;
}

/* Pet name overlay on the preview */
.calendar-preview-pet-name {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  z-index: 2;
  letter-spacing: 0.5px;
}

/* Legacy upload preview (for non-cropped) */
.upload-preview:not(.calendar-preview-image) {
  width: 120px;
  height: 213px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-success);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.upload-filename {
  font-size: 0.875rem;
  color: var(--color-text);
  font-weight: 500;
}

.btn-submit {
  width: 100%;
  max-width: 340px;
  min-height: 52px;
  font-size: 1.0625rem;
}

.cf-turnstile {
  margin: 1rem 0;
  display: flex;
  justify-content: center;
}

.recaptcha-notice {
  margin-top: var(--spacing-md);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}

.recaptcha-notice a {
  color: inherit;
  text-decoration: underline;
}

/* Photo Tips */
.photo-tips-image {
  margin: var(--spacing-lg) 0;
  text-align: center;
}

.photo-tips-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* Success Screen */
.success-content {
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

.success-logo {
  margin-bottom: var(--spacing-2xl);
}

.success-logo img {
  max-width: 220px;
  height: auto;
  animation: successPop 0.5s ease;
}

@media (min-width: 768px) {
  .success-logo img {
    max-width: 280px;
  }
}

@keyframes successPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--spacing-lg);
}

.success-message {
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  color: var(--color-text-light);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Pet Mascots */
.pets-mascot {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  pointer-events: none;
  z-index: 10;
}

.pets-mascot img {
  width: 100%;
  height: auto;
}

/* Navigation Arrows */
.nav-arrows {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  transition: opacity 0.25s ease;
}

.nav-arrows.hidden {
  opacity: 0;
  pointer-events: none;
}

.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px; /* 48px — exceeds 44px Fitts's Law minimum */
  background: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.nav-up {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-down {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.nav-arrow:hover {
  background: var(--color-primary-hover);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Crop Modal */
.crop-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: url('assets/background.jpg') center/cover no-repeat;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.crop-modal.active {
  display: flex;
  opacity: 1;
}

.crop-modal-content {
  background: white;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 720px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  margin: 0 auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* Crop Header */
.crop-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  padding-top: max(var(--spacing-md), env(safe-area-inset-top));
  flex-shrink: 0;
}

.crop-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.crop-back-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.crop-header-text {
  flex: 1;
  min-width: 0;
}

.crop-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

.crop-description {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

.crop-pet-name {
  color: var(--color-primary);
  font-weight: 600;
}

/* Crop Canvas Area */
.crop-canvas-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.crop-container {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  overflow: hidden;
  touch-action: none;
  -webkit-touch-callout: none;
}

.crop-container img {
  display: block;
  max-width: 100%;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Crop Controls */
.crop-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  margin: var(--spacing-sm) var(--spacing-lg) 0;
  background: #f5f5f5;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.zoom-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.zoom-label {
  font-size: 0.875rem;
  color: var(--color-text-light);
  white-space: nowrap;
}

#zoomSlider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-input-border);
  border-radius: 2px;
  outline: none;
}

#zoomSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(243, 129, 129, 0.3);
}

#zoomSlider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(243, 129, 129, 0.3);
}

/* Crop Actions */
.crop-actions {
  display: flex;
  padding: var(--spacing-md) var(--spacing-lg);
  padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.btn-crop-confirm {
  width: 100%;
  min-height: 52px;
  font-size: 1.0625rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
}

.btn-crop-confirm:hover {
  background: var(--color-primary-hover);
  transform: scale(1.01);
}

.btn-crop-confirm:active {
  transform: scale(0.98);
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.loading-overlay.active {
  display: flex;
}

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

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

.loading-text {
  font-size: 1rem;
  color: var(--color-text-light);
}

/* Error States */
.text-input.error,
.date-input.error {
  border-bottom-color: var(--color-error);
}

.error-message {
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-top: var(--spacing-xs);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Touch devices — hide keyboard hints */
@media (pointer: coarse) {
  .hint {
    display: none;
  }
}

/* Mobile crop modal adjustments */
@media (max-width: 520px) {
  .crop-header {
    padding: var(--spacing-sm) var(--spacing-md);
    padding-top: max(var(--spacing-sm), env(safe-area-inset-top));
  }

  .crop-title {
    font-size: 1rem;
  }

  .crop-description {
    font-size: 0.75rem;
  }

  .crop-controls {
    margin: var(--spacing-xs) var(--spacing-md) 0;
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .crop-actions {
    padding: var(--spacing-sm) var(--spacing-md);
    padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
  }
}

/* Small phones */
@media (max-width: 375px) {
  .form-container {
    padding: var(--spacing-md);
  }

  .question-text {
    font-size: 1.125rem;
  }

  .text-input {
    font-size: 1rem;
  }

  .date-input {
    width: 50px;
    font-size: 1rem;
  }

  .date-input-year {
    width: 65px;
  }

  .upload-zone {
    padding: var(--spacing-lg);
  }

  .nav-arrows {
    bottom: var(--spacing-md);
    right: var(--spacing-md);
  }

  .pets-mascot {
    max-width: 300px;
  }
}

/* Tablets and up */
@media (min-width: 768px) {
  .form-container {
    padding: var(--spacing-2xl);
    padding-bottom: 250px;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .btn-choice {
    max-width: 350px;
  }

  .crop-modal-content {
    padding: var(--spacing-xl);
  }

  .pets-mascot {
    max-width: 600px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .form-container {
    padding-bottom: 300px;
  }

  .nav-arrows {
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
  }

  /* Constrain button widths on desktop — full-width only on mobile */
  .btn-start {
    width: auto;
    min-width: 240px;
  }

  .btn-ok {
    width: auto;
    min-width: 120px;
  }

  .btn-submit {
    width: auto;
    min-width: 180px;
  }
}

/* Landscape phones - hide mascots to save space */
@media (max-height: 500px) and (orientation: landscape) {
  .pets-mascot {
    display: none;
  }

  .form-container {
    padding-bottom: var(--spacing-xl);
  }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-input-border: #000;
    --color-text-light: #333;
  }

  .btn-primary {
    border: 2px solid #000;
  }
}

/* Dark mode - optional, can enable later */
/*
@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #FFFFFF;
    --color-text-light: #AAAAAA;
    --color-bg-light: rgba(255, 255, 255, 0.1);
  }

  body {
    background: linear-gradient(135deg, #1a3a4a 0%, #4a3a2a 50%, #1a3a4a 100%);
  }

  .crop-modal-content {
    background: #2a2a2a;
  }
}
*/
