/* ==========================================================================
   ANA SAYFA (index.html) — aydinlik tema, solda mesaj + basvuru karti, sagda gercekci giris videosu
   23.10.2026: Gateway prototiplerinden (V1 / V2 / V2 Light / 3D / video) secilen tasarim.
   Hareket sistemi: mikro 120-220 ms, bilesen 200-350 ms, giris 350-600 ms; yalniz transform / opacity animasyonu.
   Video: js/home.js ekrana gore kaynak secer, oturumda bir kez oynatir, kol diklesince kartta tek seferlik vurgu.
   ========================================================================== */

:root {
  --home-bg: #f6f5f1;
  --home-navy: #0b1f4d;
  --home-ink: #0a1424;
  --home-muted: #5b6577;
  --home-line: #e3e5e9;
  --home-blue: #0f3ba2;
  --home-blue-2: #1548c8;
  --home-gold: #ffd000;
  --home-out: cubic-bezier(0.16, 1, 0.3, 1);
  --home-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --home-gutter: clamp(24px, 5.5vw, 96px);
}

html:has(body.home) {
  background: var(--home-bg);
  --parkie-left-inset: 0px; /* iletisim cubugu sayfanin icinde; Parkie'nin sol payi yok */
}

body.home {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding-bottom: 0 !important; /* style.css mobilde sabit alt cubuk icin 60 px birakir; burada cubuk akista */
  background: var(--home-bg);
  color: var(--home-ink);
  font-family: 'Inter', var(--font-body, system-ui, sans-serif);
  overflow-x: hidden;
}

/* --- Gorsel alani: masaustunde sag bolge --- */
.home-stage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 56%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.home-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  background: var(--home-bg);
  pointer-events: none;
}

@media (min-width: 960px) {
  /* Video bolgeyi yukseklikte zorla doldurmaz (asiri yakin kadraj); tum sahne (bina, arac, kol, kabin) gorunur,
     sag kenardan hafif tasar. Ust / alt / sol kenar acik zemine erir: iki bolge arasinda cizgi yok. */
  .home-video {
    inset: auto;
    left: 0;
    top: 50%;
    width: 112%;
    height: auto;
    aspect-ratio: 1440 / 1000;
    transform: translateY(-50%);
    -webkit-mask-image:
      linear-gradient(to right, transparent 0, #000 10%),
      linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right, transparent 0, #000 10%),
      linear-gradient(to bottom, transparent 0, #000 12%, #000 80%, transparent 100%);
    mask-composite: intersect;
  }
}

/* --- Ust serit --- */
.home-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px var(--home-gutter);
}

.home-logo {
  display: inline-flex;
  border-radius: 10px;
}

.home-logo img {
  display: block;
  height: 48px;
  width: auto;
}

.home-account {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.3rem 1.1rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 20, 36, 0.1);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--home-navy);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(10, 20, 36, 0.05);
  transition: border-color 200ms ease, box-shadow 220ms var(--home-out), transform 200ms var(--home-out);
}

.home-account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 59, 162, 0.08);
  color: var(--home-blue);
  transition: background 200ms ease, color 200ms ease;
}

.home-account:hover {
  border-color: rgba(15, 59, 162, 0.3);
  box-shadow: 0 10px 22px -12px rgba(15, 59, 162, 0.4);
  transform: translateY(-1px);
}

.home-account:hover .home-account-icon {
  background: var(--home-blue);
  color: #ffffff;
}

.home-logo:focus-visible,
.home-account:focus-visible,
.home-btn:focus-visible,
.home .custom-select-trigger:focus-visible,
.home .custom-select-option:focus-visible,
.home-footer a:focus-visible,
.home .home-support a:focus-visible {
  outline: 3px solid rgba(15, 59, 162, 0.55);
  outline-offset: 2px;
}

/* --- Sol bolge: mesaj + basvuru --- */
/* z-index alt bilginin (2) ustunde: acilan otopark listesi alt bilgiye tasar ve onun ustunde kalmali */
.home-main {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  align-items: center;
  width: 46%;
  min-width: 0;
  box-sizing: border-box;
  padding: 4px 0 20px var(--home-gutter);
}

.home-content {
  width: 100%;
  max-width: 500px;
}

.home-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(2.9rem, min(4.7vw, 8.4vh), 5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--home-navy);
}

.home-dot {
  color: var(--home-gold);
}

.home-lead {
  margin: clamp(14px, 2.4vh, 22px) 0 0;
  max-width: 30rem;
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  line-height: 1.6;
  color: var(--home-muted);
}

/* --- Basvuru karti --- */
.home-card {
  position: relative;
  z-index: 3;
  margin-top: clamp(18px, 3.6vh, 36px);
  box-sizing: border-box;
  padding: 26px 26px 24px;
  border-radius: 20px;
  background: #ffffff;
  color: var(--home-ink);
  border: 1px solid var(--home-line);
  box-shadow:
    0 1px 2px rgba(10, 20, 36, 0.04),
    0 20px 44px -22px rgba(10, 20, 36, 0.22);
}

/* Karsilama vurgusu (videoda kol diklesince, .home-welcome): ust kenarda kisa isik + tek seferlik ince halka */
.home-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  right: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--home-gold), transparent);
  opacity: 0;
  pointer-events: none;
}

.home-card::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 25px;
  border: 2px solid rgba(15, 59, 162, 0.28);
  opacity: 0;
  pointer-events: none;
}

.home-card.home-welcome::before {
  animation: home-sweep 900ms var(--home-out) both;
}

.home-card.home-welcome::after {
  animation: home-welcome 1100ms var(--home-out) both;
}

.home-card-title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
  color: var(--home-navy);
}

.home-card-sub {
  margin: 0.35rem 0 1.35rem;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--home-muted);
}

.home-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-navy);
}

.home .custom-select-trigger {
  min-height: 58px;
  padding: 0 1rem 0 1.1rem;
  border-radius: 14px;
  border: 1.5px solid rgba(10, 20, 36, 0.12);
  background: #ffffff;
  font-size: 0.98rem;
  transition: border-color 180ms ease, box-shadow 220ms var(--home-out);
}

.home .custom-select-trigger:hover {
  border-color: rgba(15, 59, 162, 0.35);
}

.home .custom-select-container.open .custom-select-trigger {
  border-color: var(--home-blue);
  box-shadow: 0 0 0 4px rgba(15, 59, 162, 0.1);
}

.home .custom-select-trigger-text {
  color: var(--home-muted);
  font-weight: 500;
}

.home .home-has-value .custom-select-trigger {
  border-color: rgba(15, 59, 162, 0.45);
}

.home .home-has-value .custom-select-trigger-text {
  color: var(--home-navy);
  font-weight: 700;
  animation: home-value-in 260ms var(--home-out);
}

/* Secim yokken yer kaplamaz (genislik aninda acilir; yalniz opaklik / olcek animasyonlu) */
.home-check {
  display: inline-flex;
  width: 0;
  height: 20px;
  margin-right: 0;
  overflow: hidden;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #10b981;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.4);
  flex-shrink: 0;
  transition: opacity 180ms ease, transform 260ms var(--home-spring);
}

.home-has-value .home-check {
  width: 20px;
  margin-right: 0.5rem;
  opacity: 1;
  transform: none;
}

.home .custom-select-panel {
  border-radius: 16px;
  transform-origin: top center;
  transition: opacity 180ms ease, transform 240ms var(--home-out);
}

.home .custom-select-container:not(.open) .custom-select-panel {
  transform: translateY(-6px) scale(0.98);
}

.home .custom-select-option:focus-visible {
  outline-offset: -3px;
  background: rgba(15, 59, 162, 0.06);
}

/* Dogrulama mesaji (secim yapmadan devam edilirse; tarayici uyarisi yerine) */
.home-error {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #b91c1c;
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  overflow: hidden;
  transition: opacity 200ms ease, transform 220ms var(--home-out);
}

.home-error.is-visible {
  opacity: 1;
  transform: none;
  max-height: 60px;
}

.home-invalid .custom-select-trigger {
  border-color: #ef4444 !important;
  animation: home-nudge 320ms ease;
}

/* Ana aksiyon */
.home-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 56px;
  margin-top: 1rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--home-blue-2) 0%, var(--home-blue) 58%, #0a2c7d 100%);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 12px 24px -12px rgba(15, 59, 162, 0.6);
  transition: transform 160ms var(--home-out), box-shadow 220ms var(--home-out), filter 180ms ease;
}

.home-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 220ms var(--home-spring);
}

.home-btn:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 18px 32px -14px rgba(15, 59, 162, 0.7);
  transform: translateY(-1px);
}

.home-btn:hover:not(:disabled) svg {
  transform: translateX(3px);
}

.home-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
  transition-duration: 120ms;
}

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

.home-ready .home-btn {
  animation: home-ready 420ms var(--home-out);
}

/* --- Butunlesik destek alani (common.js iletisim bilesenleri buraya tasinir: telefon / WhatsApp / e-posta) --- */
.home-support {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.home-support-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a93a3;
}

.home .home-support .contact-sidebar {
  position: static;
  transform: none;
  flex-direction: row;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: none;
  opacity: 1;
  z-index: auto;
}

.home .home-support .contact-sidebar-item {
  width: auto;
  height: 44px;
  gap: 8px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--home-line);
  color: var(--home-navy);
  box-shadow: 0 1px 2px rgba(10, 20, 36, 0.04);
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 180ms ease, box-shadow 200ms var(--home-out), transform 180ms var(--home-out);
}

.home .home-support .contact-sidebar-item i,
.home .home-support .contact-sidebar-item svg {
  width: 16px !important;
  height: 16px !important;
}

.home .home-support .contact-sidebar-item:hover,
.home .home-support .contact-sidebar-item:focus-visible {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: rgba(15, 59, 162, 0.3);
  color: var(--home-blue);
  box-shadow: 0 8px 18px -10px rgba(15, 59, 162, 0.35);
}

.home .home-support .contact-sidebar-item:hover i,
.home .home-support .contact-sidebar-item:hover svg {
  transform: none;
}

.home .home-support .contact-sidebar-tooltip,
.home .home-support .contact-sidebar-item:hover .contact-sidebar-tooltip,
.home .home-support .contact-sidebar-item:focus-visible .contact-sidebar-tooltip {
  position: static;
  transform: none;
  opacity: 1;
  visibility: visible;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.home .home-support .contact-sidebar-mail-wrapper > .contact-sidebar-item::after {
  content: "E-posta";
}

/* E-posta secenekleri satirin ustunde acilir */
.home .home-support .contact-mail-menu {
  left: 0;
  top: auto;
  bottom: calc(100% + 10px);
  transform: translateY(6px);
}

.home .home-support .contact-mail-menu::before {
  left: 0;
  top: 100%;
  width: 100%;
  height: 12px;
}

.home .home-support .contact-sidebar-mail-wrapper:hover .contact-mail-menu,
.home .home-support .contact-sidebar-mail-wrapper:focus-within .contact-mail-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.home .home-support .contact-mobile-bar {
  position: static;
  flex: 1;
  height: auto;
  gap: 8px;
  justify-content: flex-start;
  background: none;
  border: 0;
  box-shadow: none;
  animation: none;
  opacity: 1;
  z-index: auto;
}

.home .home-support .contact-mobile-bar-item {
  flex: 1;
  flex-direction: row;
  gap: 6px;
  min-height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--home-line);
  color: var(--home-navy);
  font-size: 0.82rem;
  font-weight: 600;
}

.home .home-support .contact-mobile-bar-item:active {
  background: #f1f3f6;
}

/* --- Alt bilgi --- */
.home-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  width: 46%;
  box-sizing: border-box;
  padding: 0 0 22px var(--home-gutter);
  font-size: 0.78rem;
  color: #7b8494;
}

.home-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}

.home-footer a:hover {
  color: var(--home-navy);
}

/* --- Parkie: masaustunde sag altta, videonun uzerinde (balon basvuru kartini ortmez).
   Yalniz varsayilan konum; kullanici surukleyip biraktiysa (satir ici left/top) onun konumu gecerli. --- */
body.home .parkie-container:not([style*="left"]) {
  left: auto;
  right: 24px;
  align-items: flex-end;
}

/* --- Giris (oturumda bir kez, js/home_boot.js .home-play koyar; JS gerekmez, animasyon kendiliginden biter) --- */
.home-play .home-enter {
  animation: home-rise 560ms var(--home-out) both;
  animation-delay: calc(120ms + var(--i, 0) * 90ms);
}

.home-play .home-card {
  animation: home-card-in 520ms var(--home-out) 280ms both;
}

.home-play .home-support,
.home-play .home-footer {
  animation: home-fade 600ms ease 500ms both;
}

@keyframes home-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes home-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes home-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes home-value-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes home-nudge {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
}

@keyframes home-ready {
  0% { transform: scale(1); }
  40% { transform: scale(1.012); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 0 0 4px rgba(15, 59, 162, 0.14), 0 14px 28px -12px rgba(15, 59, 162, 0.65); }
  100% { transform: scale(1); }
}

@keyframes home-sweep {
  0% { opacity: 0; transform: scaleX(0.15); }
  40% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

@keyframes home-welcome {
  0% { opacity: 0; transform: scale(1.025); }
  35% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

/* ==========================================================================
   TABLET + MOBIL (<= 959 px): video basligin saginda kucuk pencere, form hemen altinda (asagi itilmez)
   ========================================================================== */
@media (max-width: 959px) {
  .home-header {
    order: 0;
    padding: 14px 16px;
  }

  .home-logo img {
    height: 42px;
  }

  .home-account {
    font-size: 0.88rem;
    padding-right: 0.9rem;
  }

  .home-stage {
    position: absolute;
    top: 70px;
    right: 0;
    bottom: auto;
    width: 36vw;
    height: 23.6vw;
    -webkit-mask-image:
      linear-gradient(to right, transparent 0, #000 38%),
      linear-gradient(to bottom, #000 0, #000 72%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right, transparent 0, #000 38%),
      linear-gradient(to bottom, #000 0, #000 72%, transparent 100%);
    mask-composite: intersect;
  }

  .home-main {
    order: 2;
    align-items: flex-start;
    width: 100%;
    padding: 6px 16px 0;
  }

  .home-content {
    max-width: 560px;
    margin: 0 auto;
  }

  .home-title {
    font-size: clamp(2.1rem, 9vw, 3.4rem);
  }

  .home-lead {
    margin-top: 10px;
    font-size: 0.97rem;
    line-height: 1.55;
  }

  .home-card {
    margin-top: 18px;
    padding: 22px 20px 20px;
    border-radius: 18px;
  }

  .home-card-title {
    font-size: 1.25rem;
  }

  .home-card-sub {
    margin-bottom: 1.1rem;
    font-size: 0.9rem;
  }

  .home-footer {
    order: 3;
    width: 100%;
    max-width: 592px;
    margin: 0 auto;
    padding: 18px 16px 88px; /* Parkie icin pay */
  }
}

@media (max-width: 768px) {
  .home-support {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-width: 560px;
  }

  /* Parkie mobilde sag altta ve kucuk; alt iletisim cubugu akista oldugu icin ekranin dibine yakin durur */
  html body.home .parkie-container.parkie-living {
    left: auto !important;
    right: 12px !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    align-items: flex-end !important;
  }

  body.home .parkie-living .parkie-avatar-wrapper {
    width: 50px;
    height: 50px;
  }

  /* Baglantilar sag alttaki Parkie'nin altinda kalmasin */
  .home-footer {
    padding-right: 76px;
  }
}

/* Kisa telefon ekrani (iPhone SE 1. nesil vb.): video kalkar (indirilmez), form ilk ekranda kalir */
@media (max-width: 959px) and (max-height: 640px) {
  .home-stage {
    display: none;
  }

  .home-main {
    margin-top: 0;
  }

  .home-header {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .home-title {
    font-size: 2.1rem;
  }

  .home-lead {
    margin-top: 8px;
    font-size: 0.9rem;
  }

  .home-card {
    margin-top: 14px;
    padding: 16px;
  }

  .home-card-title {
    margin-bottom: 0.8rem;
  }

  .home-card-sub {
    display: none;
  }

  .home .home-support .contact-mobile-bar {
    margin-right: 64px;
  }
}

/* Cok dar ve kisa ekranda destek dugmeleri yalniz simge (metin ekran okuyucuda kalir) */
@media (max-width: 360px) and (max-height: 640px) {
  .home .home-support .contact-mobile-bar-item span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* --- Hareketi azalt --- */
@media (prefers-reduced-motion: reduce) {
  .home *,
  .home *::before,
  .home *::after {
    animation: none !important;
    transition: none !important;
  }
}
