/* ============================================
   SANA ÖZEL — Doğum Günü Sürprizi
   Premium, minimal, Apple-esque pastel tasarım
   ============================================ */

:root {
  --white: #ffffff;
  --pink-mist: #fdf3f6;
  --pink-pale: #fbe8ef;
  --pink-pastel: #f4cede;
  --pink-mid: #eab2cf;
  --pink-deep: #d987b3;
  --pink-accent: #c96a9c;
  --black: #1c1c1e;
  --gray-dark: #3a3a3c;
  --gray-mid: #8e8e93;
  --gray-light: #c7c7cc;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --shadow-soft: 0 20px 60px rgba(201, 106, 156, 0.16), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 12px 30px rgba(201, 106, 156, 0.28);

  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);

  --vh: 100dvh;
}

@supports not (height: 100dvh) {
  :root { --vh: 100vh; }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, var(--white) 0%, var(--pink-mist) 55%, var(--pink-pale) 100%);
  color: var(--black);
  width: 100%;
  min-height: var(--vh);
  position: relative;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font-family: inherit;
}

/* ============ EKRAN YÖNETİMİ ============ */

.screen {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: var(--vh);
  height: var(--vh);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  opacity: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--white) 0%, var(--pink-mist) 55%, var(--pink-pale) 100%);
  transition: opacity 0.6s var(--ease-soft);
}

.screen.active {
  display: flex;
  opacity: 1;
  position: relative;
}

.screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.screen.fade-in {
  opacity: 1;
}

/* ============ BUTONLAR ============ */

.btn {
  border: none;
  outline: none;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s var(--ease-soft), box-shadow 0.18s var(--ease-soft), opacity 0.18s;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink-deep), var(--pink-accent));
  color: var(--white);
  box-shadow: var(--shadow-btn);
  padding: 17px 32px;
}

.btn-big {
  width: 100%;
  max-width: 420px;
  padding: 18px 24px;
  font-size: 18px;
  min-height: 56px;
}

/* ============ 1. ŞİFRE EKRANI ============ */

.glass-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 44px 28px 36px;
  text-align: center;
}

.heart-icon {
  font-size: 44px;
  margin-bottom: 18px;
  animation: heartbeat 2.4s ease-in-out infinite;
}

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

.pw-title {
  font-size: 21px;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: 30px;
  letter-spacing: -0.01em;
}

#password-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pw-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px; /* iOS otomatik zoom'u önler */
  border: 1.5px solid var(--pink-pastel);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.8);
  color: var(--black);
  outline: none;
  text-align: center;
  transition: border-color 0.25s var(--ease-soft), box-shadow 0.25s var(--ease-soft);
}

.pw-input:focus {
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(217, 135, 179, 0.18);
}

.pw-btn {
  width: 100%;
}

.pw-error {
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--pink-accent);
  font-weight: 500;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s var(--ease-soft), transform 0.35s var(--ease-soft);
}

.pw-error.show {
  opacity: 1;
  transform: translateY(0);
  animation: shake 0.5s var(--ease-soft);
}

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

/* ============ 2. MESAJ EKRANI ============ */

.message-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.message-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  min-height: 40vh;
  justify-content: center;
}

.line {
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-dark);
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft);
}

.line.show {
  opacity: 1;
  transform: translateY(0);
}

.line-final {
  font-size: 30px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-accent), var(--pink-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 6px;
}

.message-cta {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-soft);
}

.message-cta.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cta-question {
  font-size: 17px;
  color: var(--gray-dark);
  text-align: center;
  font-weight: 500;
  padding: 0 12px;
}

/* ============ 3. ÜRÜN EKRANI ============ */

.product-wrap {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex: 1;
  justify-content: center;
}

.gift-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--pink-accent);
  background: rgba(244, 206, 222, 0.5);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}

.product-image-frame {
  width: 100%;
  max-width: 380px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 1s var(--ease-soft), transform 1s var(--ease-soft);
}

.product-image-frame.show {
  opacity: 1;
  transform: scale(1);
}

.product-image {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 40px rgba(201, 106, 156, 0.22));
}

/* Hediye kutusu SVG'si - nefes alma animasyonu */
.gift-svg {
  animation: giftFloat 3.2s ease-in-out infinite;
}

@keyframes giftFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

.product-info {
  text-align: center;
}

.product-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.product-subtitle {
  font-size: 15px;
  color: var(--gray-mid);
  font-weight: 500;
}

/* ============ 4. SEPET EKRANI ============ */

.cart-wrap {
  width: 100%;
  max-width: 460px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

.screen-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.cart-thumb {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--pink-mist);
  flex-shrink: 0;
  padding: 6px;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 3px;
}

.cart-item-sub {
  font-size: 13.5px;
  color: var(--gray-mid);
  margin-bottom: 3px;
}

.cart-item-qty {
  font-size: 13px;
  color: var(--gray-mid);
}

.cart-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--pink-accent);
  white-space: nowrap;
}

/* ============ 5. ÖDEME EKRANI ============ */

.payment-wrap {
  width: 100%;
  max-width: 460px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.payment-option {
  width: 100%;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--pink-pastel);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.kiss-icon {
  font-size: 56px;
  margin-bottom: 14px;
  display: inline-block;
  animation: kissPulse 2.2s ease-in-out infinite;
}

@keyframes kissPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(-4deg); }
}

.payment-option-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
}

.payment-total {
  font-size: 15px;
  color: var(--gray-mid);
  font-weight: 500;
}

/* İşlem overlay */
.processing-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.4s var(--ease-soft);
}

.processing-overlay.show {
  display: flex;
  opacity: 1;
}

.processing-content {
  text-align: center;
}

.processing-kiss {
  font-size: 52px;
  animation: kissSpin 1.1s ease-in-out infinite;
  margin-bottom: 16px;
}

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

.processing-text {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--gray-dark);
}

.processing-sub {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-mid);
  margin-top: 8px;
  min-height: 18px;
}

.btn-resend {
  margin-top: 26px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease-soft);
  padding: 10px;
}

.btn-resend.show {
  opacity: 1;
  pointer-events: auto;
}

/* ============ 6. FİNAL EKRANI ============ */

.final-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  z-index: 5;
}

.final-line {
  font-size: 19px;
  font-weight: 600;
  color: var(--gray-dark);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-soft);
}

.final-line.show {
  opacity: 1;
  transform: translateY(0);
}

.final-line-big {
  font-size: 32px;
  font-weight: 800;
  color: var(--black);
  margin-top: 6px;
}

.final-line-main {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-accent), var(--pink-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.final-line-small {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-mid);
  margin-top: 4px;
}

/* ============ SÜRPRİZ AÇILIŞI (kutu → gerçek ürün) ============ */

.reveal-stage {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 340px;
  margin: 6px auto 4px;
}

.reveal-box,
.reveal-product {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft);
}

.reveal-box {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.reveal-box.hide {
  opacity: 0;
  transform: scale(0.7) rotate(-8deg);
  pointer-events: none;
}

.reveal-product {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}

.reveal-product.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.reveal-product-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  border-radius: 20px;
  filter: drop-shadow(0 22px 40px rgba(201, 106, 156, 0.28));
}

/* ============ ALT SABİT BUTON ALANI ============ */

.bottom-bar {
  width: 100%;
  max-width: 460px;
  display: flex;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============ SEPETE EKLEME MİKRO ANİMASYONU ============ */

.btn-added {
  background: linear-gradient(135deg, #7ed99a, #4fbb73) !important;
}

.pop {
  animation: popScale 0.4s var(--ease-soft);
}

@keyframes popScale {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ============ KONFETİ CANVAS ============ */

#confetti-canvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  display: none;
}

#confetti-canvas.show {
  display: block;
}

/* ============ ERİŞİLEBİLİRLİK: HAREKETİ AZALT ============ */

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

/* ============ KÜÇÜK EKRANLAR ============ */

@media (max-height: 700px) {
  .message-lines { min-height: 32vh; gap: 10px; }
  .line { font-size: 20px; }
  .line-final { font-size: 25px; }
  .product-image-frame { max-width: 300px; }
}

@media (min-width: 480px) {
  .line { font-size: 26px; }
}
