/* =====================================================================
   PUBLIC SITE + LOGIN PREMIUM LAYER  (additive, motion & polish only)
   Keeps your colors/layout. Marker: public-premium v1
   ===================================================================== */

:root {
  --ap-ease: cubic-bezier(.32, .72, 0, 1);
  --ap-spring: cubic-bezier(.34, 1.45, .64, 1);
  --ap-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Google Sans Flex", "Lexend", system-ui, "Segoe UI", Roboto, sans-serif;
}

/* no iOS focus-zoom, no double-tap zoom */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
html, body, * { touch-action: manipulation; }
@media (pointer: coarse), (max-width: 1024px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  select, textarea, .form-control { font-size: 16px !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

* { font-family: var(--ap-font); }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, h3 { letter-spacing: -.02em; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary-color, #ff8432) 75%, #fff); outline-offset: 2px; border-radius: 8px; }

/* ---------------- public pages ---------------- */
.header { transition: box-shadow .45s var(--ap-ease), background-color .4s var(--ap-ease); }
.header.is-scrolled { box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .4); }
.header-links a { transition: color .3s var(--ap-ease), opacity .3s ease; }

.btn, .btn-primary, .btn-outline, .btn-ghost, a[class*="btn"], .nav-toggle {
  -webkit-tap-highlight-color: transparent;
  transition: transform .35s var(--ap-ease), box-shadow .45s var(--ap-ease), background-color .3s ease, color .3s ease, border-color .3s ease, filter .3s ease;
}
@media (hover: hover) {
  .btn:hover, .btn-primary:hover, .btn-outline:hover, .btn-ghost:hover { transform: translateY(-2px); }
  .btn-primary:hover { filter: brightness(1.06); }
}
.btn:active, .btn-primary:active, .btn-outline:active, .btn-ghost:active, a[class*="btn"]:active, .nav-toggle:active { transform: scale(.97); }

.why-card, .step-card, .review-card, .info-card, .stats-card, .security-item, .mp-store-card, .faq-item, .platform-pill {
  transition: transform .6s var(--ap-ease), box-shadow .6s var(--ap-ease), border-color .35s ease, background-color .3s ease;
}
@media (hover: hover) {
  .why-card:hover, .step-card:hover, .review-card:hover, .info-card:hover, .stats-card:hover, .security-item:hover, .mp-store-card:hover {
    transform: translateY(-4px); box-shadow: 0 30px 56px -26px rgba(16, 24, 40, .35);
  }
}

/* hero entrance (pure CSS) */
@keyframes ap-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-content > * { animation: ap-rise .9s var(--ap-ease) both; }
.hero-content > *:nth-child(1) { animation-delay: .05s; }
.hero-content > *:nth-child(2) { animation-delay: .14s; }
.hero-content > *:nth-child(3) { animation-delay: .23s; }
.hero-content > *:nth-child(4) { animation-delay: .32s; }
.hero-content > *:nth-child(5) { animation-delay: .41s; }
.hero-content > *:nth-child(6) { animation-delay: .5s; }

/* scroll reveal (a tiny script adds these classes; without it nothing is hidden) */
.ap-reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ap-ease), transform .9s var(--ap-ease); transition-delay: var(--ap-delay, 0ms); }
.ap-reveal.ap-in { opacity: 1; transform: none; }
@media print { .ap-reveal { opacity: 1 !important; transform: none !important; } }

/* ---------------- login / register / reset ---------------- */
@keyframes ap-pop { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-wrapper { animation: ap-pop .85s var(--ap-ease) both; }
.auth-header > * { animation: ap-rise .8s var(--ap-ease) both; }
.auth-header > *:nth-child(1) { animation-delay: .12s; }
.auth-header > *:nth-child(2) { animation-delay: .2s; }
.auth-header > *:nth-child(3) { animation-delay: .28s; }
.auth-wrapper .form-control { transition: border-color .3s var(--ap-ease), box-shadow .3s var(--ap-ease), background-color .3s ease; }
.auth-wrapper .form-control:focus { border-color: #7038ef; box-shadow: 0 0 0 4px rgba(112, 56, 239, .16); }
.auth-wrapper .btn, .auth-wrapper .btn-primary {
  transition: transform .35s var(--ap-ease), box-shadow .45s var(--ap-ease), filter .3s ease;
  box-shadow: 0 16px 30px -16px rgba(91, 54, 239, .65);
}
@media (hover: hover) { .auth-wrapper .btn:hover, .auth-wrapper .btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); } }
.auth-wrapper .btn:active, .auth-wrapper .btn-primary:active { transform: scale(.98); }
.auth-footer a, .forgot-password a { transition: opacity .25s ease; }
.auth-footer a:hover, .forgot-password a:hover { opacity: .75; }

/* smooth cross-fade between pages (Chrome/Edge/Safari; ignored elsewhere) */
@view-transition { navigation: auto; }
.header { view-transition-name: ap-pub-header; }
::view-transition-old(root) { animation: 220ms var(--ap-ease) both ap-fade-out; }
::view-transition-new(root) { animation: 380ms var(--ap-ease) both ap-fade-in; }
@keyframes ap-fade-out { to { opacity: 0; } }
@keyframes ap-fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  .ap-reveal { opacity: 1 !important; transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
