/* ==========================================================================
   AAPKA DOST - DESIGN SYSTEM & GLOBAL STYLES
   Warm, friendly, companion-like aesthetic with glassmorphic depth & natural palettes
   ========================================================================== */

:root {
  /* Color Palette - Warm Botanical Soil, Forest Loam, Terracotta & Dawn Amber */
  --bg-primary: #0f1814;
  --bg-secondary: #16241e;
  --bg-card: rgba(26, 40, 32, 0.78);
  --bg-card-hover: rgba(34, 52, 42, 0.88);
  --bg-input: rgba(16, 26, 20, 0.95);
  --bg-glass: rgba(22, 36, 28, 0.72);
  --bg-modal-backdrop: rgba(8, 14, 11, 0.82);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.13);
  --border-highlight: rgba(110, 231, 183, 0.3);
  --border-warm: rgba(245, 158, 11, 0.25);

  /* Primary Brand Accents */
  --brand-green: #34d399;
  --brand-green-glow: rgba(52, 211, 153, 0.25);
  --brand-emerald: #10b981;
  --brand-gold: #f59e0b;
  --brand-amber: #fbbf24;
  --brand-amber-glow: rgba(245, 158, 11, 0.2);
  --brand-terracotta: #c2410c;
  --brand-terracotta-soft: rgba(194, 65, 12, 0.15);
  --brand-coral: #fb7185;
  --brand-coral-soft: rgba(251, 113, 133, 0.15);
  --brand-sage: #6ee7b7;
  --brand-soil: #2d1f17;
  --brand-night: #1e293b;

  /* Focus Indicator */
  --brand-focus-ring: #34d399;
  --brand-focus-glow: rgba(52, 211, 153, 0.35);

  /* Typography Colors */
  --text-main: #f4f7f5;
  --text-muted: #9bb0a5;
  --text-dim: #677d72;
  --text-inverse: #0b1510;
  --text-warm-cream: #fffbeb;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(52, 211, 153, 0.2);

  /* Borders & Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Dimensions */
  --max-width: 520px;
}

/* Light Theme overrides if system prefers light or user changes */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f6f8f5;
    --bg-secondary: #ebf1ec;
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-card-hover: rgba(255, 255, 255, 0.98);
    --bg-input: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-modal-backdrop: rgba(20, 32, 25, 0.55);

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.12);
    --border-highlight: rgba(16, 185, 129, 0.35);
    --border-warm: rgba(217, 119, 6, 0.3);

    --text-main: #13241b;
    --text-muted: #486052;
    --text-dim: #718a7d;
    --text-inverse: #ffffff;
    --text-warm-cream: #13241b;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(20, 45, 32, 0.08);
    --shadow-lg: 0 16px 40px rgba(20, 45, 32, 0.12);
  }
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse at 12% 8%, rgba(245, 158, 11, 0.06) 0%, transparent 42%),
    radial-gradient(ellipse at 88% 92%, rgba(194, 65, 12, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 50% 28%, rgba(52, 211, 153, 0.035) 0%, transparent 50%),
    linear-gradient(180deg, #0e1713 0%, #121e17 50%, #141b16 100%);
  background-attachment: fixed;
}

/* App Container */
.app-wrapper {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-primary);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.4);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Utilities */
.hidden {
  display: none !important;
}

.flex-1 {
  flex: 1;
}

/* Form Reset */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

input[type="text"],
input[type="password"],
input[type="time"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px var(--brand-green-glow);
}

/* ==========================================================================
   KEYBOARD ACCESSIBILITY: Visible Focus Rings (:focus-visible)
   Appears only for keyboard Tab navigation, never mouse clicks.
   ========================================================================== */
:focus {
  outline: none;
}

:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
.day-chip:focus-visible,
.filter-pill:focus-visible,
.icon-btn:focus-visible,
.btn-primary-hero:focus-visible,
.btn-secondary:focus-visible,
.preset-checkbox-item:focus-visible,
.portal-profile-btn:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-focus-ring) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px var(--brand-focus-glow) !important;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

/* Links & Typography */
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
}

.req {
  color: var(--brand-coral);
}

/* Confetti Layer */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS REDUCED MOTION
   Disables decorative continuous animations and replaces with minimal transitions.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .confetti-canvas {
    display: none !important;
  }

  .plant-living-sway,
  .plant-canvas-wrapper:hover .plant-svg,
  .water-drop,
  .new-leaf-bloom,
  .plant-recovery-shimmer,
  .pulse-dot,
  .portal-logo-icon {
    animation: none !important;
  }
}
