/* Approved secondary action tokens, shared by components and existing pages. */
/* Fixed-light portfolio surfaces keep readable controls even in a dark app shell. */
:root,
.portfolio-review-page,
.portfolio-selection-page,
.portfolio-upload-page,
.portfolio-manual-page:not(.portfolio-upload-entry),
.portfolio-statement-page:not(.portfolio-upload-entry) {
  --zi-button-secondary-bg: transparent;
  --zi-button-secondary-hover: var(--zi-color-cream-100);
  --zi-button-secondary-border: var(--zi-color-green-700);
  --zi-button-secondary-border-hover: var(--zi-color-green-700);
  --zi-button-secondary-text: var(--zi-color-green-700);
}

[data-theme="dark"],
.dark,
.zi-button-secondary--dark,
.homepage-hero-cta-secondary {
  --zi-button-secondary-bg: rgba(177, 213, 195, 0.06);
  --zi-button-secondary-hover: rgba(177, 213, 195, 0.1);
  --zi-button-secondary-border: rgba(177, 213, 195, 0.42);
  --zi-button-secondary-border-hover: rgba(177, 213, 195, 0.62);
  --zi-button-secondary-text: var(--zi-color-cream-100);
}

/* Dropdown triggers retain their form-control styling. */
:is(
  .zi-button-secondary:not([aria-haspopup]):not([data-slot="popover-trigger"]),
  .landing-header-action-outline,
  .landing-header-mobile-action-outline,
  .portfolio-selection-action--cancel,
  .portfolio-manual-action--cancel,
  .portfolio-review-action--cancel,
  .portfolio-statement-action--cancel,
  .contact-success-action-secondary,
  .homepage-hero-cta-secondary
) {
  border: 1px solid var(--zi-button-secondary-border);
  background: var(--zi-button-secondary-bg);
  color: var(--zi-button-secondary-text);
  text-decoration: none;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease;

  &:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]) {
    cursor: pointer;

    &:hover,
    &:focus-visible {
      background: var(--zi-button-secondary-hover);
      border-color: var(--zi-button-secondary-border-hover);
      color: var(--zi-button-secondary-text);
      text-decoration: none;
    }

    &:focus-visible {
      outline: 2px solid var(--zi-button-secondary-text);
      outline-offset: 3px;
    }
  }

  &:disabled,
  &[aria-disabled="true"] {
    background: var(--zi-button-secondary-bg);
    color: var(--zi-button-secondary-text);
    border-color: var(--zi-button-secondary-border);
    opacity: .5;
    cursor: not-allowed;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zi-button-secondary { transition: none; }
}
