/* ==========================================================================
   Farmato Landing Page - Color Palette from Mobile App
   ========================================================================== */

:root {
  /* Brand colors */
  --sage-green: #8FAE9E;
  --sage-green-dark: #6B8B7A;
  --light-taupe: #C8C1B8;
  --off-white: #F7F6F2;
  --soft-mustard: #D6A93B;
  --warm-grey: #7A746B;

  /* Functional */
  --background: var(--off-white);
  --text-primary: var(--warm-grey);
  --text-secondary: #9A9490;
  --border: var(--light-taupe);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Animation */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-slow) ease forwards;
}

.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease forwards;
}

/* Staggered animations */
.hero-content { animation: fadeInUp 0.6s ease 0.1s both; }
.phone-mockup { animation: fadeInUp 0.6s ease 0.2s both; }
.features { animation: fadeInUp 0.6s ease 0.3s both; }
.download { animation: fadeInUp 0.6s ease 0.4s both; }

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-xl);
}

/* Desktop: no scroll, everything fits */
@media (min-width: 768px) and (min-height: 700px) {
  body {
    overflow: auto;
  }

  .container {
    max-width: 600px;
    justify-content: center;
    padding: var(--space-xl);
  }
}

/* ==========================================================================
   Language Selector (footer dropdown)
   ========================================================================== */

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237A746B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-xs) calc(var(--space-sm) + 14px) var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-select:hover {
  border-color: var(--sage-green);
  color: var(--sage-green);
}

.lang-select:focus {
  outline: none;
  border-color: var(--sage-green);
  box-shadow: 0 0 0 2px rgba(143, 174, 158, 0.2);
}

/* Legacy button switcher (support.html / privacy.html) */
.lang-switcher {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  display: flex;
  gap: var(--space-xs);
  z-index: 100;
  animation: fadeIn 0.6s ease 0.5s both;
}

@media (min-width: 768px) {
  .lang-switcher {
    bottom: auto;
    top: var(--space-md);
  }
}

.lang-btn {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--sage-green);
  color: var(--sage-green);
}

.lang-btn.active {
  background: var(--sage-green);
  border-color: var(--sage-green);
  color: white;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  text-align: center;
}

.hero-content {
  margin-bottom: var(--space-lg);
}

.logo {
  height: 48px;
  width: auto;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sage-green-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

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

/* ==========================================================================
   Phone Mockup & Carousel
   ========================================================================== */

.phone-mockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.phone-frame {
  position: relative;
  width: 280px;
  height: 560px;
  background: white;
  border-radius: 24px;
  padding: 4px;
  border: 1px solid var(--light-taupe);
  box-shadow:
    0 20px 40px -12px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.05);
}

.carousel {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: var(--off-white);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-dots {
  display: flex;
  gap: var(--space-sm);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--light-taupe);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dot:hover {
  background: var(--sage-green);
  transform: scale(1.2);
}

.dot.active {
  background: var(--sage-green);
  width: 24px;
  border-radius: 4px;
}

/* ==========================================================================
   Features
   ========================================================================== */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  max-width: 280px;
  margin: 0 auto;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--sage-green);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature:hover .feature-icon {
  background: var(--sage-green);
  border-color: var(--sage-green);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(143, 174, 158, 0.3);
}

.feature span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ==========================================================================
   Download Buttons
   ========================================================================== */

.download {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  max-width: 320px;
  margin: 0 auto;
}

.download a {
  transition: transform var(--transition-fast);
}

.download a:hover {
  transform: translateY(-2px);
}

.store-badge {
  height: 40px;
  width: auto;
}

@media (min-width: 768px) {
  .store-badge {
    height: 48px;
  }
}

/* ==========================================================================
   Cookie Banner
   ========================================================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: var(--space-md);
  z-index: 1000;
  animation: slideUp 0.3s ease;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: center;
}

@media (min-width: 500px) {
  .cookie-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
}

.cookie-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.cookie-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
}

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

.btn-primary:hover {
  background: var(--sage-green-dark);
}

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

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

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  animation: fadeIn 0.6s ease 0.6s both;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.footer-inner {
  width: 100%;
  max-width: 375px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.footer-row {
  display: flex;
}

.footer-row + .footer-row {
  margin-top: var(--space-xs);
}

.footer-col {
  flex: 1;
}

.footer-col-right {
  text-align: right;
}

.footer-copyright {
  font-size: 0.7rem;
}

.footer a {
  color: var(--sage-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--sage-green-dark);
  text-decoration: underline;
}

/* Simple footer for subpages (support, privacy) */
.footer-simple {
  padding: var(--space-lg);
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
}

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

@media (max-width: 360px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .phone-frame {
    width: 220px;
    height: 440px;
  }

  h1 {
    font-size: 1.25rem;
  }
}

/* Larger screens */
@media (min-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  .phone-frame {
    width: 300px;
    height: 600px;
  }

  .feature-icon {
    width: 48px;
    height: 48px;
  }

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

  .features {
    max-width: 300px;
  }

  .feature span {
    font-size: 0.8rem;
  }
}
