/* ===================================================================
   PriceLantern Home — Page-specific styles
   Extends tokens.css, components.css, layouts.css
   =================================================================== */

/* ======================== HERO ======================== */
/* main padding is disabled for this page (see main.css :has) so gradient runs to the top; inset clears fixed nav */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a3d4f;
  overflow: visible;
  padding: var(--pl-main-offset) 0 200px;
}
.hero__gradient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(26, 65, 88, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 75% 15%, rgba(236, 100, 29, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #0e2636 0%, #1a3d4f 45%, #223d4c 100%);
  pointer-events: none;
}
.hero__gradient::before {
  content: "";
  position: absolute;
  inset: -28%;
  background:
    radial-gradient(ellipse 48% 40% at 38% 40%, rgba(111, 173, 219, 0.16) 0%, transparent 72%),
    radial-gradient(ellipse 38% 34% at 70% 55%, rgba(236, 100, 29, 0.09) 0%, transparent 68%);
  animation: heroMoodDrift 26s ease-in-out infinite alternate;
  will-change: transform;
}

.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero__heading {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: var(--pl-text-display);
  line-height: var(--pl-leading-tight);
  color: var(--pl-white);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero__heading-line {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.55em, 0);
  animation: heroLineIn 0.9s var(--ease-default) forwards;
}
.hero__heading-line:first-of-type { animation-delay: 0.08s; }
.hero__heading-line:last-of-type  { animation-delay: 0.2s; }
.hero__accent { color: var(--pl-orange); }

.hero__sub {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  line-height: 1.5;
  color: var(--pl-text-muted-dark);
  max-width: 540px;
  margin: 0 auto 2rem;
}
.hero__sub--reveal {
  opacity: 0;
  animation: heroFadeUp 0.8s var(--ease-default) 0.36s forwards;
}

.hero__form { margin-bottom: 0.75rem; }
.hero__form--reveal {
  opacity: 0;
  animation: heroFadeUp 0.8s var(--ease-default) 0.48s forwards;
}

.hero__cta {
  animation: heroCtaGlow 3.2s ease-in-out infinite;
}
.hero__cta:hover { animation: none; }

.hero__file-box {
  max-width: 380px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pl-border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.hero__file-name {
  color: var(--pl-white);
  font-weight: var(--pl-font-weight-semi);
  font-family: var(--pl-font);
  margin-bottom: 1rem;
  text-align: center;
}

.hero__formats {
  font-family: var(--pl-font);
  font-size: var(--pl-text-xs);
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}
.hero__formats--reveal {
  opacity: 0;
  animation: heroFadeUp 0.75s var(--ease-default) 0.58s forwards;
}

/* ======================== HERO ANIMATIONS ======================== */
@keyframes heroCtaGlow {
  0%, 100% { box-shadow: var(--shadow-glow-orange), 0 0 0 0 rgba(236, 100, 29, 0); }
  50% { box-shadow: 0 8px 32px rgba(236, 100, 29, 0.42), 0 0 0 5px rgba(236, 100, 29, 0.08); }
}
@keyframes heroMoodDrift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1); }
  100% { transform: translate3d(4%, 3%, 0) scale(1.07); }
}
@keyframes heroLineIn {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes heroFadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ======================== FLOATING ACTION CARD ======================== */
.action-card {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  z-index: 10;
  width: calc(100% - 64px);
  max-width: 680px;
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-9) var(--space-7);
  text-align: center;
}
.action-card__buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-5);
}
.action-card__desc {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: var(--pl-text-sm);
  color: var(--pl-text-muted-dark);
  margin: 0 0 var(--space-5);
  line-height: 1.5;
}
.action-card__link {
  border-color: var(--pl-blue);
  color: var(--pl-blue);
}
.action-card__link:hover {
  background: rgba(111, 173, 219, 0.1);
  color: var(--pl-white);
}

/* ======================== HOW IT WORKS ======================== */
.how {
  background: var(--pl-dark);
  padding: 140px 0 80px;
}
.how__card {
  padding: clamp(36px, 5vw, 64px);
  text-align: center;
}
.how__header { margin-bottom: var(--space-10); }

/* ======================== MISSION ======================== */
.mission {
  background: var(--pl-dark);
  padding: 0 0 80px;
}
.mission__card {
  padding: clamp(40px, 6vw, 80px);
}
.mission__copy {
  position: relative;
  z-index: 1;
}
.mission__heading {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: var(--pl-text-h1);
  line-height: var(--pl-leading-tight);
  color: var(--pl-white);
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}
.mission__body {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: var(--pl-text-body);
  color: rgba(255, 255, 255, 0.6);
  line-height: var(--pl-leading-relaxed);
  margin-bottom: 0.75rem;
  max-width: 38rem;
}
.mission__body:last-child { margin-bottom: 0; }

.mission__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  min-height: 0;
}
.mission__figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin: 0 auto;
  width: 100%;
  max-width: 280px;
}
.mission__glow {
  position: absolute;
  inset: 10% 5% 20%;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(236, 100, 29, 0.2) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 70% 30%, rgba(111, 173, 219, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.mission__logo-mark {
  position: relative;
  z-index: 1;
  width: min(200px, 55vw);
  height: auto;
  opacity: 0.2;
  filter: brightness(0) invert(1);
  pointer-events: none;
}
.mission__stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ======================== FEATURES ======================== */
.features {
  background: var(--pl-dark);
  padding: var(--space-24) 0;
}

/* ======================== TESTIMONIALS ======================== */
.testimonials {
  background: var(--pl-dark);
  padding: 0 0 80px;
}
.testimonials__card {
  padding: clamp(36px, 5vw, 64px);
  text-align: center;
}
.testimonials__header { margin-bottom: var(--space-9); }
.testimonials__grid { text-align: left; }

/* ======================== FINAL CTA ======================== */
.final-cta {
  background: linear-gradient(170deg, var(--pl-teal) 0%, var(--pl-dark) 100%);
  padding: var(--space-24) 0;
  text-align: center;
}
.final-cta__inner {
  max-width: 560px;
  margin: 0 auto;
}
.final-cta__heading {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  font-size: var(--pl-text-h1);
  line-height: var(--pl-leading-tight);
  color: var(--pl-white);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.final-cta__sub {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: 1rem;
  color: var(--pl-text-muted-dark);
  margin-bottom: 2rem;
}

/* ======================== LOADER OVERLAY ======================== */
#analyzing-loader {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  flex-direction: column;
  text-align: center;
  background: rgba(10, 30, 44, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: loaderIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
#analyzing-loader.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
body.analyzing-active { overflow: hidden; }
body.analyzing-active main,
body.analyzing-active nav,
body.analyzing-active footer { pointer-events: none; user-select: none; }
@keyframes loaderIn { from { opacity: 0; } to { opacity: 1; } }

/* -- Content container -- */
.loader__content {
  position: relative;
  z-index: 2;
  max-width: 380px;
  width: 100%;
  padding: 0 24px;
}

/* -- Scanning ring (uses inline SVG animateTransform for cross-browser) -- */
.loader__ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 32px;
}
.loader__ring svg { display: block; }
.loader__ring-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPulse 2.4s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* -- Status text -- */
.loader__title {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: 1.25rem;
  color: var(--pl-white);
  margin: 0 0 4px;
  min-height: 1.6em;
  transition: opacity 0.3s;
}
.loader__sub {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: var(--pl-text-sm);
  color: var(--pl-text-muted-dark);
  margin: 0 0 28px;
  min-height: 1.4em;
  transition: opacity 0.3s;
}
.loader__title.fade, .loader__sub.fade,
.loader__fact.fade { opacity: 0; }

/* -- Progress bar -- */
.loader__progress-track {
  position: relative;
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}
.loader__progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #d85a18, #ec641d, #f5913a);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Shimmer sweep across the fill */
.loader__progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: barShimmer 2s ease-in-out infinite;
}
.loader__progress-glow {
  position: absolute;
  top: -6px;
  left: 0%;
  width: 48px;
  height: 19px;
  background: radial-gradient(ellipse at center, rgba(236, 100, 29, 0.5) 0%, transparent 70%);
  border-radius: 50%;
  transition: left 1s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
@keyframes barShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loader__time {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.28);
  margin: 0 0 32px;
  letter-spacing: 0.01em;
  transition: opacity 0.4s;
}

/* -- Fun facts -- */
.loader__facts {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 22px;
}
.loader__fact-label {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(111, 173, 219, 0.7);
  margin-bottom: 8px;
}
.loader__fact {
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-regular);
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.6;
  margin: 0;
  min-height: 2.8em;
  transition: opacity 0.35s;
}

/* -- Floating particles -- */
.loader__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.loader__particle {
  position: absolute;
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-bold);
  color: var(--pl-orange);
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}
.loader__particle:nth-child(1) { left: 12%; font-size: 1rem; animation-delay: 0s; }
.loader__particle:nth-child(2) { left: 28%; font-size: 0.75rem; animation-delay: 1.3s; color: var(--pl-blue); }
.loader__particle:nth-child(3) { left: 52%; font-size: 0.9rem; animation-delay: 2.8s; }
.loader__particle:nth-child(4) { left: 70%; font-size: 0.7rem; animation-delay: 4.1s; color: var(--pl-green); }
.loader__particle:nth-child(5) { left: 85%; font-size: 1.1rem; animation-delay: 5.5s; }
.loader__particle:nth-child(6) { left: 40%; font-size: 0.65rem; animation-delay: 6.8s; color: var(--pl-blue); }

@keyframes particleFloat {
  0%   { bottom: -10%; opacity: 0; transform: translateX(0) scale(0.7); }
  10%  { opacity: 0.15; }
  50%  { opacity: 0.08; transform: translateX(-20px) scale(1); }
  90%  { opacity: 0.12; }
  100% { bottom: 105%; opacity: 0; transform: translateX(15px) scale(0.8); }
}

/* -- Reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .loader__ring svg animateTransform { display: none; }
  .loader__ring-icon { animation: none; }
  .loader__particle { animation: none; display: none; }
  .loader__progress-fill { transition: width 0.1s linear; }
  .loader__progress-fill::after { animation: none; }
  .loader__progress-glow { display: none; }
}

/* ======================== FLOATING UPLOAD CTA ======================== */
.floating-upload {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: rgba(10, 30, 44, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--pl-white);
  border: 2px solid var(--pl-orange);
  border-radius: var(--radius-pill);
  font-family: var(--pl-font);
  font-weight: var(--pl-font-weight-semi);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform var(--duration-normal), box-shadow var(--duration-normal), opacity 0.35s, background var(--duration-normal), border-color var(--duration-normal);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.floating-upload.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.floating-upload:hover {
  background: var(--pl-orange);
  border-color: #f07830;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(236, 100, 29, 0.35);
  color: var(--pl-white);
}
.floating-upload svg { flex-shrink: 0; }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 991px) {
  .testimonials__grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

@media (max-width: 767px) {
  .hero { padding: 120px 0 180px; min-height: auto; }
  .action-card {
    width: calc(100% - 32px);
    padding: var(--space-6) var(--space-5) var(--space-5);
    border-radius: var(--radius-lg);
  }
  .action-card__buttons { flex-direction: column; gap: var(--space-3); }
  .action-card__buttons .pl-btn { justify-content: center; width: 100%; }
  .how { padding-top: 160px; }
  .how__card,
  .testimonials__card { border-radius: var(--radius-lg); padding: 28px 20px; }
  .mission__card { border-radius: var(--radius-lg); padding: 32px 24px; }
}

@media (max-width: 480px) {
  .floating-upload span { display: none; }
  .floating-upload { padding: 12px; }
}

/* ======================== REDUCED MOTION ======================== */
@media (prefers-reduced-motion: reduce) {
  .hero__gradient::before { animation: none; }
  .hero__heading-line { opacity: 1; transform: none; animation: none; }
  .hero__sub--reveal,
  .hero__form--reveal,
  .hero__formats--reveal { opacity: 1; animation: none; transform: none; }
  .hero__cta { animation: none; }
}

/* ===================================================================
   Upload UX additions — drag-drop, paste-from-clipboard hint, full-page
   drop overlay, and inline error message. Strictly additive to the
   existing hero/form layout. The button-based picker remains the
   primary affordance; these are alternative input methods.
   =================================================================== */

/* Hint row that sits below "JPG, PNG, or PDF files supported" */
.hero__formats--hint {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: var(--pl-text-xs);
  color: rgba(255, 255, 255, 0.55);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}
.hero__hint-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.hero__hint-item svg { opacity: 0.7; }
.hero__hint-sep { opacity: 0.4; }

/* Inline error shown when an unsupported file is dropped/pasted. */
.upload-inline-error {
  margin: var(--space-3) auto 0;
  max-width: 380px;
  padding: 10px 14px;
  background: var(--pl-red-light);
  border: 1px solid rgba(255, 77, 79, 0.25);
  color: #ffd5d5;
  border-radius: var(--radius-sm);
  font-size: var(--pl-text-sm);
  text-align: center;
  transition: opacity 0.4s ease;
}
.upload-inline-error.fade-out { opacity: 0; }

/* Full-page drop overlay — only `is-active` while a file is being dragged. */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background: rgba(10, 30, 44, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.drop-overlay.is-active {
  display: flex;
  opacity: 1;
}
.drop-overlay__inner {
  border: 2px dashed var(--pl-orange);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-16);
  background: rgba(236, 100, 29, 0.06);
  text-align: center;
  color: var(--pl-white);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-glow-orange);
  animation: dropOverlayPulse 1.6s ease-in-out infinite;
}
.drop-overlay__icon {
  display: inline-flex;
  width: 88px;
  height: 88px;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: rgba(236, 100, 29, 0.18);
  color: var(--pl-orange);
}
.drop-overlay__title {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: var(--pl-font-weight-semi);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.drop-overlay__sub {
  font-size: var(--pl-text-sm);
  color: rgba(255, 255, 255, 0.7);
}

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

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

@media (max-width: 480px) {
  .hero__formats--hint { font-size: 11px; gap: var(--space-2); }
  .drop-overlay__inner { padding: var(--space-8) var(--space-6); }
  .drop-overlay__icon { width: 64px; height: 64px; }
}
