/* Shared button behaviour for the four app pages (Tarot, Sanje, Znamenja, Moj prostor, SL + EN).
   The pages keep their own gradients and borders (page identity); this file owns size, hover,
   disabled and focus so every page behaves the same.

   Per-page hooks, set in a :root rule on the page:
     --btn-accent     ring colour and tint of the Google sign-in button
     --btn-auth-from / --btn-auth-to   dark surface of the Google sign-in button
   Hover fills with the page's own --violet-deep.
   The "html body" prefix lets these rules win over page rules such as ".modal .pricing-btn". */

/* One size: 46px, .74rem, .16em. */
html body :is(.btn, .pricing-btn) {
  align-items: center;
  justify-content: center;
  min-height: 46px;
  font-size: .74rem;
  letter-spacing: .16em;
  text-align: center;
  cursor: pointer;
}

/* One small size for the My Space micro-buttons. */
html body :is(.plan-row-right :is(.btn, button), .cycle-week .btn, .cycle-history-item :is(.btn, button)) {
  min-height: 36px;
  padding: .4rem .8rem;
  font-size: .66rem;
}

/* One hover: lift 1px, darken to the page's deep colour, white text. */
html body :is(.btn, .pricing-btn):hover:not(:disabled, .google-auth-btn, .danger, .active) {
  background: var(--violet-deep);
  border-color: var(--violet-deep);
  color: #fff;
  transform: translateY(-1px);
}
html body .btn.danger:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* One disabled state: dim, do not recolour. */
html body :is(.btn, .pricing-btn):disabled,
html body :is(.btn, .pricing-btn)[aria-disabled="true"] {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* One focus ring: 2px in the page accent, 3px away from the edge. */
html body :is(.btn, .pricing-btn, .google-auth-btn):focus-visible {
  outline: 2px solid var(--btn-accent, #c7bce4);
  outline-offset: 3px;
}

/* One Google sign-in button. Always combined with .btn or .pricing-btn, so the selector
   outranks ".modal .pricing-btn" and ".btn.primary". */
html body .google-auth-btn:is(.btn, .pricing-btn) {
  background:
    radial-gradient(circle at 16% 50%, color-mix(in srgb, var(--btn-accent, #c7bce4) 16%, transparent), transparent 34%),
    linear-gradient(135deg, var(--btn-auth-from, rgba(31, 30, 43, .96)), var(--btn-auth-to, rgba(20, 19, 29, .98)));
  border-color: color-mix(in srgb, var(--btn-accent, #c7bce4) 28%, transparent);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}
html body .google-auth-btn:is(.btn, .pricing-btn):hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--btn-accent, #c7bce4) 58%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .3), 0 0 26px color-mix(in srgb, var(--btn-accent, #c7bce4) 14%, transparent);
  transform: translateY(-1px);
}
/* The full-width sign-in button: the one with the Google logo, or any inside a modal. */
html body .modal .google-auth-btn:is(.btn, .pricing-btn),
html body .google-auth-btn:is(.btn, .pricing-btn):has(> svg) {
  display: flex;
  width: 100%;
  gap: .95rem;
  margin-top: 1.5rem;
  padding: 1rem 1.45rem;
}
/* Behaviour lives in assets/js/google-auth.js ([data-google-auth]). The 46px min-height above
   already clears the 44px touch target and :focus-visible draws the page-accent ring; the
   attribute only removes the double-tap delay on phones. */
html body .google-auth-btn[data-google-auth] {
  touch-action: manipulation;
}
.google-auth-btn svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--btn-accent, #c7bce4) 16%, transparent), 0 6px 18px rgba(0, 0, 0, .18);
}

@media (prefers-reduced-motion: reduce) {
  html body :is(.btn, .pricing-btn, .google-auth-btn):hover { transform: none; }
}

/* Enak razmik med sosednjimi gumbi (.btn, .hero-cta, .pricing-btn) po celi strani.
   Strani so imele vsaka svoj gap (.55 do .8rem); zdaj ga določa samo ta vrednost, 1rem.
   Samo gap, nikoli rob: gap zamenja vrednost strani, se ne sešteje z njo, velja v vrstici in
   v stolpcu, ob prelomu na mobilnem tudi med vrsticami, in preskoči skrite gumbe
   (.tester-only, .public-offer). Vsak vsebnik vrste gumbov je flex ali grid.
   Nove vrste gumbov dobijo razmik z enim od teh razredov. Cenik (.pricing-card) in
   .upsell-option-meta ostaneta zunaj: tam javni in testerski gumb nista nikoli vidna hkrati,
   gap na kartici pa bi razmaknil še naslov, opis in ceno. */
:root { --btn-gap: 1rem; }
html body :is(
  .hero-actions, .article-actions, .modal-actions, .form-actions, .sample-actions,
  .history-actions, .story-actions, .primary-actions, .result-cta, .daily-complete-actions,
  .water-actions, .spark-actions
) {
  gap: var(--btn-gap);
}

/* Osnovni videz: en .btn za celo stran, barvo poudarka da stran prek --btn-accent.
   Strani, ki so doslej definiraše svoj .btn, tega ne potrebujejo več. */
html body .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .85rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 2px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-family: inherit;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.1;
  text-decoration: none;
  transition: background .22s ease, border-color .22s ease, color .22s ease, transform .22s ease;
}
html body .btn.primary {
  background: linear-gradient(135deg, var(--btn-accent, #a8c8e8), var(--warm, #d7c5a6));
  border-color: transparent;
  color: #120F24;
}
html body .btn.primary:hover:not(:disabled, .google-auth-btn) {
  background: linear-gradient(135deg, var(--warm, #d7c5a6), var(--btn-accent, #a8c8e8));
  color: #120F24;
}
html body .btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .3);
}
html body .btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}

/* Nekatere strani so glavni klic imenovale .hero-cta; obnaša se kot .btn, da ni dveh vrst gumbov. */
html body .hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .85rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 2px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.1;
  text-decoration: none;
  transition: background .22s ease, border-color .22s ease, color .22s ease, transform .22s ease;
}
html body .hero-cta:hover:not(:disabled) {
  background: var(--violet-deep, #4d42a0);
  border-color: var(--violet-deep, #4d42a0);
  color: #fff;
  transform: translateY(-1px);
}
