/*
  PD250 design layer
  Loaded after the compiled Lovable CSS, so these rules refine it without touching the build.
  Principles: emil-design-eng (press feedback, strong ease-out, exact transition properties,
  hover only on real pointers, reduced motion) + mobile-native (no tap flash, no input zoom,
  dynamic viewport height).
*/

:root {
  /* Calmer, deeper night sky; gold stays the hero color */
  --background: 228 45% 6%;
  --card: 228 38% 10%;
  --popover: 228 38% 10%;
  --muted: 228 28% 16%;
  --muted-foreground: 225 18% 64%;
  --input: 228 30% 20%;
  /* Borders were a loud brown-gold; make them a quiet hairline */
  --border: 38 22% 19%;
  --primary: 44 96% 54%;
  --ring: 44 96% 54%;
  --radius: 0.875rem;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --hairline: inset 0 1px 0 hsl(45 100% 96% / 0.06);
  --shadow-card: 0 1px 2px hsl(228 50% 2% / 0.5), 0 12px 32px -8px hsl(228 50% 2% / 0.6);
  --gradient-card: linear-gradient(180deg, hsl(228 36% 12%), hsl(228 40% 9%));
}

/* ---------- Base ---------- */

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: "Heebo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.005em;
}

/* Ambient glow behind every full-height page (gold from the top, a hint of purple at the bottom) */
.min-h-screen.bg-background {
  min-height: 100dvh;
  background:
    radial-gradient(60rem 30rem at 50% -10%, hsl(44 96% 54% / 0.10), transparent 70%),
    radial-gradient(40rem 24rem at 100% 110%, hsl(270 60% 50% / 0.10), transparent 70%),
    hsl(var(--background));
  background-attachment: fixed;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Money and counts should not jitter as digits change */
.text-gold, .text-primary, [class*="font-bold"] {
  font-variant-numeric: tabular-nums;
}

::selection {
  background: hsl(44 96% 54% / 0.35);
  color: hsl(45 100% 96%);
}

/* ---------- Cards ---------- */

.bg-card {
  background-image: var(--gradient-card);
  box-shadow: var(--hairline), var(--shadow-card);
}

/* ---------- Buttons: feel pressed ---------- */

button,
[role="button"],
a {
  touch-action: manipulation;
}

button,
[role="button"] {
  -webkit-user-select: none;
  user-select: none;
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-out);
}

button:not(:disabled):active,
[role="button"]:active {
  transform: scale(0.97);
}

/* Primary (gold) action: a little depth instead of a flat block */
button.bg-primary {
  background-image: linear-gradient(180deg, hsl(46 100% 62%), hsl(42 95% 50%));
  box-shadow:
    inset 0 1px 0 hsl(48 100% 85% / 0.6),
    inset 0 -1px 0 hsl(35 90% 30% / 0.35),
    0 1px 2px hsl(228 50% 2% / 0.4),
    0 6px 20px -6px hsl(44 96% 54% / 0.45);
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: calc(var(--radius) - 4px);
}

@media (hover: hover) and (pointer: fine) {
  button.bg-primary:hover {
    background-image: linear-gradient(180deg, hsl(47 100% 66%), hsl(43 96% 53%));
    box-shadow:
      inset 0 1px 0 hsl(48 100% 85% / 0.6),
      inset 0 -1px 0 hsl(35 90% 30% / 0.35),
      0 1px 2px hsl(228 50% 2% / 0.4),
      0 8px 28px -6px hsl(44 96% 54% / 0.6);
  }
}

/* Plain hover states only for real pointers, so taps don't leave things "stuck" highlighted */
@media (hover: none) {
  .hover\:underline:hover { text-decoration: none; }
}

/* ---------- Inputs ---------- */

input,
textarea,
select {
  /* 16px stops iOS from zooming the page when a field is focused */
  font-size: max(16px, 1em);
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-out);
}

input.bg-background,
textarea.bg-background {
  background-color: hsl(228 40% 7%);
  border-color: hsl(228 30% 22%);
  box-shadow: inset 0 1px 2px hsl(228 50% 2% / 0.5);
  border-radius: calc(var(--radius) - 4px);
}

input:focus-visible,
textarea:focus-visible {
  border-color: hsl(44 96% 54% / 0.7);
  --tw-ring-color: hsl(44 96% 54% / 0.35);
  --tw-ring-offset-width: 0px;
}

input::placeholder {
  color: hsl(225 15% 48%);
}

/* Visible keyboard focus everywhere, never on mouse click */
:focus-visible {
  outline-offset: 2px;
}

/* ---------- Login screen ---------- */

form input[type="password"] {
  height: 3rem;
  letter-spacing: 0.3em;
}

form input[type="password"]::placeholder {
  letter-spacing: normal;
}

form button[type="submit"] {
  height: 3rem;
  font-size: 1rem;
}

/* The card settles in once on load (rare, first-impression moment) */
.max-w-sm.bg-card {
  padding: 2rem 1.75rem 1.5rem;
  border-radius: 1.25rem;
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);

  @starting-style {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.max-w-sm.bg-card h1 {
  font-size: 1.625rem;
  font-weight: 800;
  background: linear-gradient(180deg, hsl(48 100% 72%), hsl(42 95% 52%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Reduced motion: keep fades, drop movement ---------- */

@media (prefers-reduced-motion: reduce) {
  button:active,
  [role="button"]:active {
    transform: none !important;
  }

  .max-w-sm.bg-card {
    @starting-style {
      transform: none;
    }
  }

  .animate-float,
  .animate-shimmer,
  .animate-pulse-gold {
    animation: none !important;
  }
}

/* ---------- Zodiac signs: white symbol on a glossy colored circle (as in the explainer video) ---------- */

.pd-zodiac {
  --c: #8a5cff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  font-variant-emoji: text;
  background:
    radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.45) 0%, rgb(255 255 255 / 0) 42%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c) 100%, #fff 8%) 0%, var(--c) 60%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  box-shadow:
    inset 0 -2px 3px rgb(0 0 0 / 0.25),
    0 2px 6px rgb(0 0 0 / 0.35),
    0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.25);
}

@media (min-width: 640px) {
  .pd-zodiac { width: 2.9rem; height: 2.9rem; font-size: 1.7rem; }
}

.pd-zodiac[data-sign="aries"]       { --c: #e53935; }
.pd-zodiac[data-sign="taurus"]      { --c: #f4511e; }
.pd-zodiac[data-sign="gemini"]      { --c: #fb8c00; }
.pd-zodiac[data-sign="cancer"]      { --c: #f9b800; }
.pd-zodiac[data-sign="leo"]         { --c: #fdd000; }
.pd-zodiac[data-sign="virgo"]       { --c: #7cb342; }
.pd-zodiac[data-sign="libra"]       { --c: #43a047; }
.pd-zodiac[data-sign="scorpio"]     { --c: #00897b; }
.pd-zodiac[data-sign="sagittarius"] { --c: #1e88e5; }
.pd-zodiac[data-sign="capricorn"]   { --c: #7e57c2; }
.pd-zodiac[data-sign="aquarius"]    { --c: #ab47bc; }
.pd-zodiac[data-sign="pisces"]      { --c: #ec407a; }
