/* Shared action language: primary, secondary, quiet, controls and clickable cards. */
:root {
  --action-radius: var(--r-md);
  --action-font: var(--font-h);
  --action-tracking: 0.08em;
  --action-border: rgba(var(--gold-muted-rgb), 0.42);
  --action-surface: rgba(var(--gold-muted-rgb), 0.09);
  --action-text: var(--gold-light);
  --action-focus: #ffffff;
}

:is(.nav-link-cosmic, .app-home-link, .hero-cta, .final-cta,
  .btn-cta, .btn-oracle, .btn-skip, .hero-secondary, .btn-back,
  .today-share-button, .today-card-link, .preview-profile-link,
  .act2-nav-btn, .act2-labels-btn, .act2-btn-go,
  .act2-btn-today, .act2-mobile-toggle, .country-selected-change, .country-result-item,
  .cosmic-app-icon-button) {
  font-family: var(--action-font);
  font-weight: 700;
  letter-spacing: var(--action-tracking);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease, color 180ms ease;
}

/* Primary actions: the visual reference used by final-cta. */
:is(.hero-cta, .final-cta, .btn-cta, .btn-oracle, .act2-btn-go) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid rgba(var(--gold-light-rgb), 0.48);
  border-radius: var(--action-radius);
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 48%, var(--gold-light) 100%);
  box-shadow: 0 8px 28px rgba(var(--gold-muted-rgb), 0.24);
  color: #06051a;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

:is(.final-cta) { min-height: 54px; padding-inline: 28px; }

:is(.hero-cta, .final-cta, .btn-cta, .btn-oracle, .act2-btn-go):hover {
  transform: translateY(-2px);
  border-color: #fff6ba;
  box-shadow: 0 12px 34px rgba(var(--gold-muted-rgb), 0.36);
}

/* A restrained shimmer is reserved for the gold, high-priority CTAs. */

:is(.hero-cta, .final-cta, .btn-cta, .btn-oracle, .act2-btn-go)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 47%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.18) 53%,
    transparent 65%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: cosmic-gold-shimmer 2.8s ease-in-out infinite;
}

@keyframes cosmic-gold-shimmer {
  100% { transform: translateX(100%); }
}

/* Form submit actions in Lectura Cósmica are continuously signposted by two soft gold pulses. */
.screen-actions > .btn-cta {
  overflow: visible;
  background-image:
    linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.22) 47%, rgba(255, 255, 255, 0.36) 50%, rgba(255, 255, 255, 0.22) 53%, transparent 65%),
    linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 48%, var(--gold-light) 100%);
  background-position: -150% 0, 0 0;
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: cosmic-form-cta-shimmer 2.8s ease-in-out infinite;
}

.screen-actions > .btn-cta::before,
.screen-actions > .btn-cta::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 2px solid rgba(var(--gold-rgb), 0.58);
  border-radius: inherit;
  filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
}

.screen-actions > .btn-cta::before {
  inset: -2px;
  animation: cosmic-form-pulse-inner 2.4s ease-out infinite;
}

.screen-actions > .btn-cta::after {
  inset: -6px;
  border-color: rgba(var(--gold-light-rgb), 0.36);
  background: none;
  transform: none;
  animation: cosmic-form-pulse-outer 2.4s ease-out 1.2s infinite;
}

@keyframes cosmic-form-cta-shimmer {
  100% { background-position: 150% 0, 0 0; }
}

@keyframes cosmic-form-pulse-inner {
  0% { inset: -2px; opacity: 0; }
  20% { opacity: 0.72; }
  100% { inset: -16px; opacity: 0; }
}

@keyframes cosmic-form-pulse-outer {
  0% { inset: -6px; opacity: 0; }
  25% { opacity: 0.58; }
  100% { inset: -24px; opacity: 0; }
}

/* Secondary actions remain quieter, but share the same type, border and shape. */
:is(.nav-link-cosmic, .app-home-link, .hero-secondary, .btn-skip,
  .today-share-button, .today-card-link, .preview-profile-link, .act2-nav-btn,
  .act2-labels-btn, .act2-btn-today, .act2-mobile-toggle, .country-selected-change,
  .country-result-item, .cosmic-app-icon-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--action-border);
  border-radius: var(--action-radius);
  background: var(--action-surface);
  box-shadow: none;
  color: var(--action-text);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}

:is(.nav-link-cosmic, .app-home-link, .hero-secondary, .btn-skip,
  .today-share-button, .today-card-link, .preview-profile-link, .act2-nav-btn,
  .act2-labels-btn, .act2-btn-today, .act2-mobile-toggle, .country-selected-change,
  .country-result-item, .cosmic-app-icon-button):hover {
  transform: translateY(-1px);
  border-color: rgba(var(--gold-light-rgb), 0.7);
  background: rgba(var(--gold-muted-rgb), 0.17);
  color: #ffffff;
}

.act2-mobile-toggle {
  justify-content: space-between;
  text-align: left;
}

/* Quiet navigation keeps a low visual weight while remaining recognizably actionable. */
:is(.btn-back) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--action-radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

:is(.btn-back):hover {
  border-color: rgba(var(--gold-muted-rgb), 0.28);
  background: rgba(var(--gold-muted-rgb), 0.07);
  color: #ffffff;
}

/* Small state controls and filters. */
:is(.lunar-scene-control-group button) {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(var(--gold-muted-rgb), 0.3);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-family: var(--action-font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

:is(.lunar-scene-control-group button):hover,
:is(.lunar-scene-control-group button)[aria-pressed="true"] {
  border-color: rgba(var(--gold-light-rgb), 0.64);
  background: rgba(var(--gold-muted-rgb), 0.15);
  color: #ffffff;
}

/* Compact camera controls: four views fit on one line whenever the panel allows it. */
.lunar-scene-control-group {
  flex-wrap: nowrap;
  gap: 4px;
}

:is(.lunar-scene-control-group button) {
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

/* Selectable cards use the same feedback and border language without becoming CTAs. */
:is(.profile-data-card, .profile-destination-card, .gender-btn) {
  border-radius: var(--action-radius);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease;
}

:is(.profile-data-card, .profile-destination-card, .gender-btn):hover {
  transform: translateY(-2px);
  border-color: rgba(var(--gold-light-rgb), 0.68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

/* Actions injected by the shared application shell follow the same hierarchy too. */
:is(.cosmic-app-primary-link, .cosmic-app-dock-link) {
  border-radius: var(--action-radius);
  font-family: var(--action-font);
  letter-spacing: 0.06em;
}

.cosmic-app-profile-action {
  border-radius: var(--action-radius);
  font-family: var(--action-font);
  letter-spacing: var(--action-tracking);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease, color 180ms ease;
}

.cosmic-app-profile-action:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--gold-light-rgb), 0.7);
  background: rgba(var(--gold-muted-rgb), 0.17);
  color: #ffffff;
}

:is(.cosmic-app-drawer-close) {
  border-radius: var(--action-radius);
  border-color: rgba(var(--gold-muted-rgb), 0.3);
  color: var(--gold-light);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

:is(.cosmic-app-drawer-close):hover {
  transform: translateY(-1px);
  border-color: rgba(var(--gold-light-rgb), 0.64);
  background: rgba(var(--gold-muted-rgb), 0.15);
  color: #ffffff;
}

/* Persistent navigation uses a deliberate hover lift instead of magnetic movement. */
:is(.cosmic-app-primary-link, .cosmic-app-menu-button) {
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease,
    background 200ms ease, border-color 200ms ease, color 200ms ease;
}

:is(.cosmic-app-primary-link, .cosmic-app-menu-button):hover,
:is(.cosmic-app-primary-link, .cosmic-app-menu-button):focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 0 24px rgba(var(--gold-rgb), 0.42);
}

/* Share actions emit a short gold double-border pulse only while hovered. */
:is(.today-share-button, .cosmic-app-share-button) {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

:is(.today-share-button, .cosmic-app-share-button)::before,
:is(.today-share-button, .cosmic-app-share-button)::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 2px solid rgba(var(--gold-rgb), 0.58);
  border-radius: inherit;
  filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
}

:is(.today-share-button, .cosmic-app-share-button)::before { inset: -2px; }

:is(.today-share-button, .cosmic-app-share-button)::after {
  inset: -6px;
  border-color: rgba(var(--gold-light-rgb), 0.36);
}

:is(.today-share-button, .cosmic-app-share-button):hover::before,
:is(.today-share-button, .cosmic-app-share-button):focus-visible::before {
  animation: cosmic-share-pulse-inner 1.6s ease-out infinite;
}

:is(.today-share-button, .cosmic-app-share-button):hover::after,
:is(.today-share-button, .cosmic-app-share-button):focus-visible::after {
  animation: cosmic-share-pulse-outer 1.6s ease-out 0.8s infinite;
}

@keyframes cosmic-share-pulse-inner {
  0% { inset: -2px; opacity: 0; }
  20% { opacity: 0.72; }
  100% { inset: -16px; opacity: 0; }
}

@keyframes cosmic-share-pulse-outer {
  0% { inset: -6px; opacity: 0; }
  25% { opacity: 0.58; }
  100% { inset: -24px; opacity: 0; }
}

:is(.hero-cta, .final-cta, .btn-cta, .btn-oracle, .act2-btn-go,
  .nav-link-cosmic, .app-home-link, .hero-secondary, .btn-skip,
  .btn-back, .today-share-button, .today-card-link, .preview-profile-link,
  .act2-nav-btn, .act2-labels-btn, .act2-btn-today, .act2-mobile-toggle,
  .country-selected-change, .country-result-item, .cosmic-app-icon-button,
  .lunar-scene-control-group button,
  .profile-data-card, .profile-destination-card, .gender-btn, .cosmic-app-primary-link,
  .cosmic-app-dock-link, .cosmic-app-profile-action, .cosmic-app-drawer-close):focus-visible {
  outline: 3px solid var(--action-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--bg), 0 0 24px rgba(var(--gold-light-rgb), 0.34);
}

:is(button, .hero-cta, .final-cta, .hero-secondary, .today-card-link)[disabled],
:is(button)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

/* A small pointer/touch response gives every action a consistent depth cue. */
.cosmic-magnetic-action {
  transform-style: preserve-3d;
  perspective: 480px;
  will-change: transform;
  touch-action: manipulation;
}

.cosmic-magnetic-action.is-magnetic-active {
  transition: transform 70ms linear, box-shadow 180ms ease, background 180ms ease,
    border-color 180ms ease, color 180ms ease !important;
}

@media (max-width: 760px) {
  :is(.hero-cta, .final-cta, .btn-cta, .btn-oracle, .btn-skip) { width: 100%; }
  .nav-link-cosmic { min-height: 40px; padding-inline: 11px; font-size: 10px; }
}

@media (max-width: 420px) {
  .lunar-scene-control-group { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-magnetic-action { will-change: auto; }

  :is(.cosmic-app-primary-link, .cosmic-app-menu-button):hover,
  :is(.cosmic-app-primary-link, .cosmic-app-menu-button):focus-visible {
    transform: none;
  }

  :is(.today-share-button, .cosmic-app-share-button)::before,
  :is(.today-share-button, .cosmic-app-share-button)::after {
    animation: none;
  }

  .screen-actions > .btn-cta,
  .screen-actions > .btn-cta::before,
  .screen-actions > .btn-cta::after {
    animation: none;
  }

  :is(.hero-cta, .final-cta, .btn-cta, .btn-oracle, .act2-btn-go)::after {
    animation: none;
  }

  :is(.nav-link-cosmic, .app-home-link, .hero-cta, .final-cta,
    .btn-cta, .btn-oracle, .btn-skip, .hero-secondary, .btn-back,
    .today-share-button, .today-card-link, .preview-profile-link, .act2-nav-btn,
    .act2-labels-btn, .act2-btn-go, .act2-btn-today, .act2-mobile-toggle,
    .country-selected-change, .country-result-item, .cosmic-app-icon-button,
    .profile-data-card, .profile-destination-card, .gender-btn) { transition: none; }
}
