/* ===== DestinyCharm / LuckyFlow — Main Stylesheet ===== */
/* Theme: Dark (#1a1a2e) + Gold (#d4af37) + White (#ffffff) */

/* ----- Reset & Base ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #1a1a2e;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-glow: rgba(212,175,55,0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.7);
  --text-muted: rgba(255,255,255,0.4);
  --border-subtle: rgba(212,175,55,0.2);
  --border-card: rgba(255,255,255,0.08);
  --danger: #ff6b6b;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 800px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold-light); }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----- Typography ----- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

/* ----- Utility ----- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-gold { color: var(--gold); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* ===== LANDING PAGE ===== */

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 40px 20px;
}

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

.hero-bg-video,
.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

/* Animated golden circle */
.hero-bg-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60vmin;
  height: 60vmin;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  transform: translate(-50%, -50%);
  animation: pulse-rotate 8s ease-in-out infinite;
}

.hero-bg-circle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40vmin;
  height: 40vmin;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.1);
  transform: translate(-50%, -50%);
}

.hero-bg-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20vmin;
  height: 20vmin;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes pulse-rotate {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.05); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* Hero Content */
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 2rem;
}

/* ----- Form Card ----- */
.form-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}

/* Select dropdown: keep selected text white on dark bg, but options dark on light dropdown */
select.form-input {
  color-scheme: dark;
  cursor: pointer;
}
select.form-input option {
  color: #1a1a2e;
  background: #ffffff;
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.35rem;
  display: none;
}
.form-error.visible { display: block; }

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  letter-spacing: 0.02em;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--gold-glow);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit .spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--bg-dark);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Trust Element */
.trust-badge {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.trust-badge .pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Footer Disclaimer */
.footer-disclaimer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(26,26,46,0.9);
  backdrop-filter: blur(8px);
  z-index: 100;
}

/* ===== RESULT PAGE ===== */

/* Loading Overlay */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Lotus animation (CSS-drawn) */
.lotus {
  width: 80px;
  height: 80px;
  position: relative;
  margin-bottom: 2rem;
}

.lotus-petal {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 20px;
  height: 40px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, var(--gold-light), transparent);
  opacity: 0;
  transform-origin: bottom center;
}

.lotus-petal:nth-child(1) { transform: translateX(-50%) rotate(0deg);   animation: petal-bloom 1.5s ease 0.0s forwards; }
.lotus-petal:nth-child(2) { transform: translateX(-50%) rotate(36deg);  animation: petal-bloom 1.5s ease 0.2s forwards; }
.lotus-petal:nth-child(3) { transform: translateX(-50%) rotate(72deg);  animation: petal-bloom 1.5s ease 0.4s forwards; }
.lotus-petal:nth-child(4) { transform: translateX(-50%) rotate(108deg); animation: petal-bloom 1.5s ease 0.6s forwards; }
.lotus-petal:nth-child(5) { transform: translateX(-50%) rotate(144deg); animation: petal-bloom 1.5s ease 0.8s forwards; }
.lotus-petal:nth-child(6) { transform: translateX(-50%) rotate(180deg); animation: petal-bloom 1.5s ease 0.3s forwards; }
.lotus-petal:nth-child(7) { transform: translateX(-50%) rotate(216deg); animation: petal-bloom 1.5s ease 0.5s forwards; }
.lotus-petal:nth-child(8) { transform: translateX(-50%) rotate(252deg); animation: petal-bloom 1.5s ease 0.7s forwards; }
.lotus-petal:nth-child(9) { transform: translateX(-50%) rotate(288deg); animation: petal-bloom 1.5s ease 0.9s forwards; }
.lotus-petal:nth-child(10) { transform: translateX(-50%) rotate(324deg); animation: petal-bloom 1.5s ease 1.1s forwards; }

@keyframes petal-bloom {
  0% { opacity: 0; transform: translateX(-50%) rotate(var(--r, 0deg)) scaleY(0); }
  60% { opacity: 0.8; }
  100% { opacity: 0.6; transform: translateX(-50%) rotate(var(--r, 0deg)) scaleY(1); }
}

.lotus-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), var(--gold));
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: lotus-glow 2s ease-in-out infinite;
}

@keyframes lotus-glow {
  0%, 100% { box-shadow: 0 0 10px var(--gold-glow); }
  50% { box-shadow: 0 0 25px var(--gold-glow); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-secondary);
  min-height: 2rem;
  text-align: center;
  animation: text-fade 0.5s ease;
}

.loading-timeout {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: none;
}
.loading-timeout.visible { display: block; }

@keyframes text-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Result Content */
.result-content {
  padding: 80px 20px 60px;
  display: none;
}
.result-content.visible { display: block; }

/* Greeting */
.result-greeting {
  text-align: center;
  margin-bottom: 3rem;
}

.result-greeting .user-name {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  display: block;
  margin-bottom: 0.5rem;
}

.result-greeting .greeting-text {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Report Cards */
.report-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), background var(--transition);
}

.report-card:hover {
  border-color: var(--border-subtle);
  background: var(--bg-card-hover);
}

.report-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.report-card-icon {
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212,175,55,0.1);
  border-radius: var(--radius-sm);
}

.report-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold);
}

.report-card-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Transition Hook */
.result-transition {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: 2.5rem;
  padding: 0 1rem;
  position: relative;
}

.result-transition::before,
.result-transition::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  margin: 1.5rem auto;
}

.result-transition::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* Product Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-subtle);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: rgba(255,255,255,0.03);
}

.product-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(212,175,55,0.05), rgba(26,26,46,1));
  color: var(--text-muted);
  font-size: 0.9rem;
}

.product-info {
  padding: 1rem 1.25rem 1.25rem;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.product-reason {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.product-price-original {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-price-discounted {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
}

.btn-shop {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.btn-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--gold-glow);
  color: var(--bg-dark);
}

/* Trust Badges Row */
.trust-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-card);
}

.trust-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Share & Save Row */
.action-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-action {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* Email input row */
.email-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.email-input {
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  min-width: 240px;
  transition: border-color var(--transition);
}

.email-input:focus {
  border-color: var(--gold);
}

.email-btn {
  padding: 0.75rem 1.5rem;
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg-dark);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.email-btn:hover { opacity: 0.9; }

.email-thanks {
  display: none;
  color: var(--gold);
  font-size: 0.9rem;
  text-align: center;
}
.email-thanks.visible { display: block; }

/* ===== PRIVACY PAGE ===== */
.privacy-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 80px 20px 60px;
}

.privacy-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.privacy-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
}

.privacy-section {
  margin-bottom: 2rem;
}

.privacy-section h2 {
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.privacy-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===== LANGUAGE SELECTOR ===== */
.lang-selector {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.lang-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.lang-btn.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(212,175,55,0.1);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 768px) {
  .form-card {
    padding: 1.5rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .trust-row {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .action-row {
    flex-direction: column;
    align-items: center;
  }

  .btn-action {
    width: 100%;
    max-width: 320px;
    text-align: center;
  }

  .email-row {
    flex-direction: column;
    align-items: center;
  }

  .email-input {
    width: 100%;
    max-width: 320px;
  }

  .result-content {
    padding: 60px 16px 60px;
  }

  .privacy-page {
    padding: 60px 16px 60px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .hero {
    padding: 20px 16px;
    min-height: 100dvh;
  }

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

  .form-card {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
  }

  .form-input {
    padding: 0.75rem 0.875rem;
    font-size: 16px; /* prevent iOS zoom */
  }

  .btn-submit {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .report-card {
    padding: 1.25rem;
  }

  .trust-item {
    font-size: 0.8rem;
  }

  .lang-selector {
    top: 0.5rem;
    right: 0.5rem;
  }

  .lang-btn {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

/* ===== PRINT ===== */
@media print {
  .footer-disclaimer,
  .lang-selector,
  .action-row,
  .email-row,
  .btn-shop,
  .trust-row { display: none; }

  .result-content { padding: 20px; }
  body { background: #fff; color: #000; }
  .report-card { background: #f5f5f5; border-color: #ddd; }
  .report-card-body { color: #333; }
  .product-card { break-inside: avoid; }
}
