/* Qred Partner Landingpage — feintuning on top of Tailwind */

:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-feature-settings: "ss01", "cv11", "cv02";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Improve Instrument Serif rendering */
.font-serif {
  font-feature-settings: "dlig", "liga", "kern";
}

/* Remove default marker on <details> in all browsers */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Subtle focus ring */
:focus-visible {
  outline: 2px solid #0f3d2e;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection already handled via Tailwind but double-ensure */
::selection {
  background-color: #ddfed9;
  color: #0f3d2e;
}

/* Reduce motion — accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Alpine x-collapse smoothing */
[x-cloak] { display: none !important; }

/* Pretty balanced text for headlines */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* Image safety in legacy browsers */
img { max-width: 100%; height: auto; }

/* =========================================================
   Kreditrechner Slider — custom styled range input
   ========================================================= */
.qred-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #0f3d2e 0%, #0f3d2e var(--qred-pct, 33%), #e4e4e7 var(--qred-pct, 33%), #e4e4e7 100%);
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.qred-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #0f3d2e;
  border: 4px solid #ddfed9;
  box-shadow: 0 2px 8px rgba(15, 61, 46, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qred-range::-webkit-slider-thumb:hover,
.qred-range::-webkit-slider-thumb:active {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(15, 61, 46, 0.45);
}

.qred-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #0f3d2e;
  border: 4px solid #ddfed9;
  box-shadow: 0 2px 8px rgba(15, 61, 46, 0.35);
  cursor: grab;
}

.qred-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #e4e4e7;
}

.qred-range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #0f3d2e;
}

/* =========================================================
   Reveal-on-scroll  (subtle fade + slide-up)
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s var(--ease-out-quart),
    transform 0.8s var(--ease-out-quart);
  will-change: opacity, transform;
}
[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="1"].in-view { transition-delay: 0.06s; }
[data-reveal-delay="2"].in-view { transition-delay: 0.12s; }
[data-reveal-delay="3"].in-view { transition-delay: 0.18s; }
[data-reveal-delay="4"].in-view { transition-delay: 0.24s; }
[data-reveal-delay="5"].in-view { transition-delay: 0.30s; }
[data-reveal-delay="6"].in-view { transition-delay: 0.36s; }

/* Stagger children — used with [data-stagger] on parent */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease-out-quart),
    transform 0.7s var(--ease-out-quart);
  will-change: opacity, transform;
}
[data-stagger].in-view > * {
  opacity: 1;
  transform: translateY(0);
}
[data-stagger].in-view > *:nth-child(1) { transition-delay: 0.04s; }
[data-stagger].in-view > *:nth-child(2) { transition-delay: 0.10s; }
[data-stagger].in-view > *:nth-child(3) { transition-delay: 0.16s; }
[data-stagger].in-view > *:nth-child(4) { transition-delay: 0.22s; }
[data-stagger].in-view > *:nth-child(5) { transition-delay: 0.28s; }
[data-stagger].in-view > *:nth-child(6) { transition-delay: 0.34s; }

/* =========================================================
   Card hover lift — subtle interactive feedback
   ========================================================= */
.card-hover {
  transition:
    transform 0.35s var(--ease-out-quart),
    box-shadow 0.35s var(--ease-out-quart),
    border-color 0.35s var(--ease-out-quart);
  will-change: transform;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px -14px rgba(10, 10, 10, 0.22),
              0 0 0 1px rgba(10, 10, 10, 0.08);
}

/* Button press feedback */
a[class*="bg-ink"]:active,
a[class*="bg-dark"]:active,
a[class*="bg-mint"]:active {
  transform: scale(0.98);
  transition: transform 0.1s ease-out;
}

/* Arrow-slide inside CTAs */
.group:hover .cta-arrow {
  transform: translateX(2px);
}
.cta-arrow {
  transition: transform 0.25s var(--ease-out-quart);
}

/* Underline grow on text links */
.link-underline {
  background-image: linear-gradient(#0f3d2e, #0f3d2e);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size 0.3s var(--ease-out-quart);
  padding-bottom: 2px;
}
.link-underline:hover {
  background-size: 100% 2px;
}

/* Float animation for badge — keep existing, add soft shadow pulse */
@keyframes soft-pulse {
  0%, 100% { box-shadow: 0 1px 2px rgba(10,10,10,0.04), 0 0 0 1px rgba(10,10,10,0.05); }
  50%      { box-shadow: 0 8px 24px -8px rgba(15,61,46,0.28), 0 0 0 1px rgba(15,61,46,0.08); }
}

/* Reduce motion — honor preferences */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].in-view,
  [data-stagger] > *,
  [data-stagger].in-view > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .card-hover:hover { transform: none; }
}

/* =========================================================
   Mobile optimization — iPhone, iPad, Tablet
   ========================================================= */

/* Prevent horizontal overflow from mesh gradients / blur elements */
html, body { overflow-x: clip; }

/* Remove iOS 300ms double-tap delay + disable long-press callouts on interactive */
a, button, [role="button"], summary, input[type="range"], label {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Sticky header offset for anchor jumps */
main section[id] { scroll-margin-top: 5rem; }

/* Sticky bottom CTA bar on mobile — big conversion win */
.mobile-cta-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.625rem 1rem;
  padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
  padding-left: calc(1rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -6px 24px -8px rgba(10, 10, 10, 0.12);
}
.mobile-cta-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: #0f3d2e;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 0.875rem 1.25rem;
  border-radius: 999px;
  min-height: 48px;
}
.mobile-cta-bar a:active { transform: scale(0.98); }

@media (max-width: 767px) {
  .mobile-cta-bar { display: block; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Small-phone fluid typography — prevent cramping on 320–380px */
@media (max-width: 380px) {
  .hero-h1 { font-size: 38px !important; line-height: 1.05 !important; }
  .calc-big { font-size: 46px !important; }
  .bento-500 { font-size: 56px !important; }
  .section-h2 { font-size: 30px !important; line-height: 1.08 !important; }
  .dark-h2 { font-size: 38px !important; line-height: 1.03 !important; }
  .stat-num { font-size: 44px !important; }
  .final-h2 { font-size: 38px !important; line-height: 1.03 !important; }
}

/* Reduce blur radii on small screens (big perf win on older iPhones) */
@media (max-width: 640px) {
  [class*="blur-3xl"] { --tw-blur: blur(48px); filter: var(--tw-blur) !important; }
  [class*="blur-2xl"] { --tw-blur: blur(32px); filter: var(--tw-blur) !important; }
  [class*="blur-[140px]"],
  [class*="blur-[130px]"],
  [class*="blur-[120px]"],
  [class*="blur-[100px]"] { filter: blur(60px) !important; }
}

/* Tighten vertical rhythm on phones — less dead space */
@media (max-width: 640px) {
  .section-pad { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
}

/* Disable float animation on small screens (jitter + battery) */
@media (max-width: 768px) {
  .animate-float { animation: none !important; }
}

/* Safe-area padding for header + footer container */
@supports (padding: max(0px)) {
  .safe-x {
    padding-left: max(1.25rem, env(safe-area-inset-left)) !important;
    padding-right: max(1.25rem, env(safe-area-inset-right)) !important;
  }
}

/* FAQ + Accordion: ensure comfortable tap-target on phones */
@media (max-width: 640px) {
  details summary, .faq-toggle { min-height: 48px; }
}

/* Prevent iOS auto-zoom on focus for inputs (font-size ≥ 16px) */
input, select, textarea { font-size: max(16px, 1em); }

/* Hide sticky mobile CTA when final CTA section is visible — optional polish */
@media (max-width: 767px) {
  body.cta-in-view .mobile-cta-bar {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
}

/* iPad/Tablet portrait (768–1023px): improve hero gap */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-grid { gap: 3rem !important; }
}

/* =========================================================
   Marketing Animations — designed for conversion
   ========================================================= */

/* Scroll-Progress indicator (top-bar that fills as user scrolls) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #0f3d2e 0%, #8de47e 50%, #ddfed9 100%);
  z-index: 70;
  transition: width 0.08s linear;
  box-shadow: 0 0 12px rgba(141, 228, 126, 0.55);
  pointer-events: none;
}

/* CTA Shimmer — subtle sheen sweep across primary buttons */
.cta-shimmer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cta-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, transparent 35%, rgba(221, 254, 217, 0.85) 50%, transparent 65%, transparent 100%);
  transform: translateX(-120%);
  animation: cta-sheen 3s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 1;
  border-radius: inherit;
}
.cta-shimmer > * { position: relative; z-index: 2; }
@keyframes cta-sheen {
  0%, 50%  { transform: translateX(-120%); }
  80%      { transform: translateX(120%); }
  100%     { transform: translateX(120%); }
}
/* Stronger shine on mint-coloured CTAs (Final CTA) */
.cta-shimmer.bg-mint::after {
  background: linear-gradient(115deg, transparent 0%, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%, transparent 100%);
  mix-blend-mode: overlay;
}

/* Mint-glow pulse on "Neu"-chip and trust badges */
@keyframes mint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(141, 228, 126, 0.65), 0 0 0 1px rgba(15, 61, 46, 0.08); }
  50%      { box-shadow: 0 0 0 14px rgba(141, 228, 126, 0), 0 0 32px -2px rgba(141, 228, 126, 0.85); }
}
.chip-pulse { animation: mint-pulse 2.0s ease-in-out infinite; }

/* Trustpilot star twinkle — staggered */
.twinkle-star {
  transform-origin: center;
  animation: twinkle 3.2s ease-in-out infinite;
  will-change: transform, opacity, filter;
}
.twinkle-star:nth-child(1) { animation-delay: 0.0s; }
.twinkle-star:nth-child(2) { animation-delay: 0.25s; }
.twinkle-star:nth-child(3) { animation-delay: 0.5s; }
.twinkle-star:nth-child(4) { animation-delay: 0.75s; }
.twinkle-star:nth-child(5) { animation-delay: 1.0s; }
@keyframes twinkle {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); opacity: 1; }
  50%      { transform: scale(1.18); filter: drop-shadow(0 0 6px rgba(141, 228, 126, 0.9)); opacity: 0.95; }
}

/* Ken-Burns slow zoom on use-case cards (idle, not only on hover) */
.kenburns {
  animation: kb 18s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes kb {
  0%   { transform: scale(1.00); }
  100% { transform: scale(1.08); }
}

/* Hero mesh gradient parallax drift */
.mesh-drift-a { animation: drift-a 14s ease-in-out infinite alternate; will-change: transform; }
.mesh-drift-b { animation: drift-b 16s ease-in-out infinite alternate; will-change: transform; }
@keyframes drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(40px, -24px, 0) scale(1.05); }
}
@keyframes drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-30px, 30px, 0) scale(1.08); }
}

/* Calculator number tween animation hook */
.calc-big {
  transition: transform 0.18s var(--ease-out-quart);
}
.calc-big.is-pulsing {
  transform: scale(1.04);
}

/* Count-up highlight on completion */
[data-countup].counted {
  animation: count-flash 0.9s ease-out;
}
@keyframes count-flash {
  0%   { text-shadow: 0 0 0 rgba(141, 228, 126, 0); }
  40%  { text-shadow: 0 0 20px rgba(141, 228, 126, 0.55); }
  100% { text-shadow: 0 0 0 rgba(141, 228, 126, 0); }
}

/* Floating "Antrag in Minuten" badge — already has animate-float; add glow */
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 2px 14px -4px rgba(15, 61, 46, 0.20); }
  50%      { box-shadow: 0 14px 32px -10px rgba(141, 228, 126, 0.45), 0 0 0 1px rgba(15, 61, 46, 0.10); }
}
.badge-glow { animation: badge-glow 4s ease-in-out infinite; }

/* Respect reduced-motion: kill all new animations */
@media (prefers-reduced-motion: reduce) {
  .cta-shimmer::after,
  .chip-pulse,
  .twinkle-star,
  .kenburns,
  .mesh-drift-a,
  .mesh-drift-b,
  .badge-glow,
  .scroll-progress { animation: none !important; transition: none !important; }
  .scroll-progress { display: none !important; }
}

/* Disable drift + ken-burns on mobile (battery / perf) */
@media (max-width: 768px) {
  .mesh-drift-a, .mesh-drift-b { animation: none !important; }
  .kenburns { animation-duration: 24s; }
}

