/* ============================================
   VISTAS VILLA · Landing Page
   Brandbook colors & type system
   ============================================ */

:root {
  --cream: #F4EFE6;
  --warm-white: #FBFAF6;
  --anthracite: #2D2D2D;
  --copper: #B8754D;
  --copper-dark: #9D5F3D;

  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 6rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--anthracite);
  background: var(--warm-white);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

/* ============================================
   HERO · full-screen
   ============================================ */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s var(--ease-soft);
  animation: kenBurns 32s ease-in-out infinite alternate;
  will-change: transform;
}

.hero-image-light { background-image: url('../assets/light.png'); }
.hero-image-dark  { background-image: url('../assets/dark.png'); }

html[data-theme="light"] .hero-image-light { opacity: 1; }
html[data-theme="light"] .hero-image-dark  { opacity: 0; }
html[data-theme="dark"]  .hero-image-light { opacity: 0; }
html[data-theme="dark"]  .hero-image-dark  { opacity: 1; }

@keyframes kenBurns {
  0%   { transform: scale(1.0) translate(0, 0); }
  100% { transform: scale(1.06) translate(-1%, -1%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image { animation: none; }
}

/* Overlay pt lizibilitate text pe orice imagine */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at center, rgba(45,45,45,0.0) 0%, rgba(45,45,45,0.25) 75%, rgba(45,45,45,0.55) 100%),
    linear-gradient(to bottom, rgba(45,45,45,0.20) 0%, rgba(45,45,45,0.05) 30%, rgba(45,45,45,0.05) 60%, rgba(45,45,45,0.45) 100%);
  pointer-events: none;
}

/* ============================================
   THEME TOGGLE · sus-dreapta
   ============================================ */

.theme-toggle {
  position: absolute;
  top: calc(1rem + var(--safe-top));
  right: calc(1rem + var(--safe-right));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s var(--ease-soft);
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) 0.2s forwards;
}

.theme-toggle:hover {
  background: rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.85);
  transform: rotate(20deg);
}

.theme-toggle:active { transform: scale(0.92); }

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================
   HERO CONTENT · centrat, apare prin animatie
   ============================================ */

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  min-height: 0;
}

/* Logo */
.brand-img {
  height: 200px;
  width: auto;
  max-width: min(85vw, 340px);
  display: block;
  margin-bottom: 1rem;
  filter:
    drop-shadow(0 4px 16px rgba(0, 0, 0, 0.55))
    drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
  image-rendering: -webkit-optimize-contrast;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: heroEntry 1.1s var(--ease-out) 0.3s both;
}

/* Launch text */
.hero-launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 1;
  transform: translateY(0);
  animation: heroEntry 1s var(--ease-out) 0.6s both;
}

.hero-launch-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.5rem 1.1rem;
  border-radius: 2px;
}

.hero-launch-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 3.2vw, 1.7rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.7),
    0 1px 3px rgba(0, 0, 0, 0.5);
  max-width: 520px;
}

/* Inline signup */
.inline-signup {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 480px;
  background: rgba(251, 250, 246, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 4px;
  padding: 5px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(184, 117, 77, 0.12);
  transition: box-shadow 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft);
  opacity: 1;
  transform: translateY(0);
  animation: heroEntry 1s var(--ease-out) 0.85s both;
}

.inline-signup:focus-within {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(184, 117, 77, 0.4);
}

.inline-signup input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 16px; /* prevent iOS zoom */
  font-weight: 400;
  padding: 0.95rem 1.1rem;
  background: transparent;
  border: none;
  color: var(--anthracite);
  outline: none;
  min-width: 0;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.inline-signup input::placeholder {
  color: rgba(45, 45, 45, 0.45);
  font-weight: 300;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--copper);
  color: #fff;
  border: none;
  padding: 0 1.5rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
  min-height: 48px;
  min-width: 48px;
  -webkit-tap-highlight-color: transparent;
}

.cta-primary:hover { background: var(--copper-dark); }
.cta-primary:active { transform: scale(0.97); }

.signup-fineprint {
  font-size: 0.8rem;
  font-weight: 400;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.5rem 1rem;
  border-radius: 2px;
  letter-spacing: 0.02em;
  max-width: 480px;
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) 1.05s forwards;
}

/* Success */
.inline-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(251, 250, 246, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  max-width: 480px;
  width: 100%;
  opacity: 0;
  transform: translateY(16px);
  animation: heroEntry 0.8s var(--ease-out) 0.2s forwards;
}

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

.success-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(184, 117, 77, 0.12);
  color: var(--copper);
}

.success-text-inline {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--anthracite);
}

.success-hint {
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(45, 45, 45, 0.6);
}

/* ============================================
   HERO FOOTER · locatia jos-stanga
   ============================================ */

.hero-footer {
  position: relative;
  z-index: 2;
  padding: 1rem 1.25rem;
  opacity: 0;
  animation: fadeIn 1.2s var(--ease-out) 1.2s forwards;
}

.location-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.5rem 1.1rem;
  border-radius: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

/* Respectă preferința user pt a reduce mișcarea, dar păstrează vizibilitatea */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-image { animation: none !important; }
  .brand-centered,
  .hero-launch,
  .inline-signup,
  .signup-fineprint,
  .theme-toggle,
  .hero-footer {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   MOBILE OPTIMIZATIONS · cross-device
   ============================================ */

/* ---- Small phones (iPhone SE 1st gen, Galaxy J, Huawei Y) ---- */
@media (max-width: 360px) {
  .hero-content {
    gap: 1.1rem;
    padding: 1rem 0.875rem;
  }

  .brand-img {
    height: 130px;
  }

  .hero-launch-eyebrow {
    font-size: 0.62rem;
    padding: 0.4rem 0.95rem;
    letter-spacing: 0.24em;
  }

  .hero-launch-title {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  /* Stack signup pe mic pt a evita ciocnire input/buton */
  .inline-signup {
    flex-direction: column;
    padding: 0;
    gap: 0;
    border-radius: 6px;
  }

  .inline-signup input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(45, 45, 45, 0.12);
    background: rgba(251, 250, 246, 0.97);
    text-align: center;
  }

  .cta-primary {
    width: 100%;
    padding: 1rem;
    border-radius: 0 0 6px 6px;
  }

  .signup-fineprint {
    font-size: 0.74rem;
    padding: 0.45rem 0.85rem;
  }

  .hero-footer {
    padding: 0.75rem 0.875rem;
  }

  .location-line {
    font-size: 0.68rem;
    padding: 0.45rem 1rem;
  }

  .theme-toggle {
    top: calc(0.75rem + var(--safe-top));
    right: calc(0.75rem + var(--safe-right));
    width: 40px;
    height: 40px;
  }
}

/* ---- Standard phones (iPhone 12/13/14, Pixel 6/7, Galaxy S22) ---- */
@media (min-width: 361px) and (max-width: 480px) {
  .brand-img {
    height: 150px;
  }

  .hero-launch-title {
    font-size: 1.15rem;
  }

  .hero-content {
    gap: 1.25rem;
    padding: 1.25rem 1rem;
  }
}

/* ---- Large phones / small tablets (iPhone Plus, Pixel Pro) ---- */
@media (min-width: 481px) and (max-width: 767px) {
  .brand-img {
    height: 170px;
  }

  .hero-content {
    gap: 1.5rem;
    padding: 1.5rem 1.5rem;
  }

  .hero-launch-title {
    font-size: 1.3rem;
  }
}

/* ---- Tablets portrait (iPad, Galaxy Tab) ---- */
@media (min-width: 768px) and (max-width: 1024px) {
  .brand-img {
    height: 200px;
  }

  .hero-content {
    gap: 1.75rem;
    padding: 2rem;
  }

  .hero-launch-title {
    font-size: 1.6rem;
  }

  .hero-launch-eyebrow {
    font-size: 0.75rem;
  }
}

/* ---- Tablets landscape / small desktop ---- */
@media (min-width: 1025px) and (max-width: 1440px) {
  .brand-img {
    height: 220px;
  }

  .hero-content {
    gap: 1.85rem;
    padding: 2rem 3rem;
  }

  .hero-launch-title {
    font-size: 1.75rem;
  }
}

/* ---- Large desktop ---- */
@media (min-width: 1441px) {
  .brand-img {
    height: 240px;
  }

  .hero-content {
    gap: 2rem;
  }

  .hero-launch-title {
    font-size: 1.9rem;
  }
}

/* ---- Landscape orientation on phones · content devine centrat orizontal cu scroll mic ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-content {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem 1.5rem;
  }

  .brand-centered {
    flex: 0 0 auto;
  }

  .brand-img {
    height: 80px;
  }

  .hero-launch {
    flex: 0 0 auto;
    text-align: left;
  }

  .hero-launch-title {
    font-size: 1rem;
  }

  .inline-signup {
    flex: 0 0 320px;
  }

  .signup-fineprint {
    flex: 0 0 100%;
    margin-top: -0.25rem;
  }
}

/* ---- High DPI / retina: subtletăți ---- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .brand-img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ---- Hover only pe dispozitive cu hover (nu touch) ---- */
@media (hover: hover) and (pointer: fine) {
  .cta-primary:hover { background: var(--copper-dark); transform: translateY(-1px); }
  .theme-toggle:hover { transform: rotate(20deg); }
}

/* ---- Safe areas iOS notch ---- */
@supports (padding: max(0px)) {
  .hero {
    padding-top: max(0px, var(--safe-top));
    padding-bottom: max(0px, var(--safe-bottom));
    padding-left: max(0px, var(--safe-left));
    padding-right: max(0px, var(--safe-right));
  }
}