/*
 * The Spotify Data API checkout in the marketing site's look
 * (spotify.checkleaked.cc: #121212 base, #1ed760 accent, Figtree, pill
 * buttons with black text). Linked only by the page the server renders for
 * the Spotify service (src/portal/portalPage.ts); every rule is scoped to
 * html[data-portal='spotify'], so nothing here can reach another checkout.
 */
html[data-portal='spotify'] {
  --primary: #1ed760;
  --primary-dark: #1db954;
  --primary-light: #1ed760;
  --secondary: #1ed760;
  --background: #121212;
  --surface: #181818;
  --surface-light: #242424;
  --text: #ffffff;
  --text-muted: #b3b3b3;
  --border: rgba(255, 255, 255, 0.12);
  --success: #1ed760;
  --warning: #ffa42b;
  --error: #ff5a5f;
  --gradient: linear-gradient(135deg, #1ed760 0%, #1db954 100%);
}

html[data-portal='spotify'] body {
  font-family:
    'Figtree',
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

html[data-portal='spotify'][data-portal-page='checkout'] .container {
  max-width: 1120px;
}

/* ── Header: the site's brand, a way back, and the pitch ── */
html[data-portal='spotify'] .portal-header {
  text-align: left;
  margin-bottom: 40px;
}

html[data-portal='spotify'] .portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 36px;
}

html[data-portal='spotify'] .portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

html[data-portal='spotify'] .portal-by {
  color: var(--text-muted);
  font-weight: 500;
}

html[data-portal='spotify'] .portal-nav-links {
  display: inline-flex;
  gap: 20px;
}

html[data-portal='spotify'] .portal-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

html[data-portal='spotify'] .portal-nav-links a:hover,
html[data-portal='spotify'] .portal-brand:hover .portal-product {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

html[data-portal='spotify'] .header h1 {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--text);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

html[data-portal='spotify'] .header p {
  margin: 0;
  max-width: 660px;
  font-size: 1.1rem;
}

html[data-portal='spotify'] .header .portal-proof {
  margin-top: 14px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Cards and controls ── */
html[data-portal='spotify'] .card {
  border-radius: 12px;
}

html[data-portal='spotify'] .card-title .icon {
  background: rgba(30, 215, 96, 0.14);
}

html[data-portal='spotify'] .submit-btn {
  color: #000;
  border-radius: 999px;
  font-weight: 700;
}

html[data-portal='spotify'] .submit-btn:hover {
  box-shadow: 0 8px 25px rgba(30, 215, 96, 0.28);
}

html[data-portal='spotify'] .submit-btn .spinner {
  border-top-color: #000;
}

html[data-portal='spotify'] .quick-btn {
  border-radius: 999px;
}

html[data-portal='spotify'] .quick-btn:hover,
html[data-portal='spotify'] .coupon-apply-btn {
  background: rgba(30, 215, 96, 0.08);
}

html[data-portal='spotify'] .quick-btn.active,
html[data-portal='spotify'] .mode-option[aria-checked='true'] {
  color: #000;
  font-weight: 600;
}

html[data-portal='spotify'] .category-btn.selected,
html[data-portal='spotify'] .gateway-btn.selected,
html[data-portal='spotify'] .autorenew:has(.autorenew-input:checked) {
  background: rgba(30, 215, 96, 0.1);
}

html[data-portal='spotify'] .category-btn:hover {
  box-shadow: 0 8px 20px rgba(30, 215, 96, 0.14);
}

html[data-portal='spotify'] .slider::-webkit-slider-thumb {
  box-shadow: 0 4px 12px rgba(30, 215, 96, 0.35);
}

html[data-portal='spotify'] .info-banner {
  background: rgba(30, 215, 96, 0.07);
  border-color: rgba(30, 215, 96, 0.35);
}

html[data-portal='spotify'] .info-banner .info-icon {
  color: var(--primary);
}

html[data-portal='spotify'] .features-list a,
html[data-portal='spotify'] .portal-existing a,
html[data-portal='spotify'] .footer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Below the order: "Already have a key?" ── */
html[data-portal='spotify'] .portal-below {
  margin-top: 40px;
}

html[data-portal='spotify'] .portal-existing p {
  color: var(--text-muted);
}

/* ── Footer: who processes payments, legal pages, disclaimer ── */
html[data-portal='spotify'] .footer p {
  font-size: 0.9rem;
}

html[data-portal='spotify'] .footer .portal-legal,
html[data-portal='spotify'] .footer .portal-disclaimer {
  margin-top: 8px;
}

/* Until /api/config is applied, the figures in the markup are another
   service's placeholders: hide them instead of flashing them. The mobile bar
   too: it copies the summary's total ("$150.00"). */
html.cfg-pending #requestsDisplay,
html.cfg-pending .slider-marks,
html.cfg-pending #requestsQuickSelect,
html.cfg-pending .price-summary,
html.cfg-pending #categoryGrid,
html.cfg-pending .info-banner p {
  visibility: hidden;
}

html.cfg-pending .mobile-bar {
  display: none !important;
}

/* The config never came: said at the top, with a reload button. */
html[data-portal='spotify'] .portal-config-error {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--error);
  border-radius: 12px;
  background: rgba(255, 90, 95, 0.1);
  color: var(--text);
  font-weight: 600;
}

html[data-portal='spotify'] .portal-config-error[hidden] {
  display: none;
}

html[data-portal='spotify'] .portal-reload-btn {
  margin-left: 6px;
  min-height: 36px;
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: #000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Under the order button: what paying agrees to. */
html[data-portal='spotify'] .portal-agree {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

html[data-portal='spotify'] .portal-agree a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Mobile: sticky total + Continue while the order button is off-screen ── */
.mobile-bar[hidden] {
  display: none !important;
}

html[data-portal='spotify'] .mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(18, 18, 18, 0.97);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

html[data-portal='spotify'] .mobile-bar-total {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

html[data-portal='spotify'] .mobile-bar-total span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

html[data-portal='spotify'] .mobile-bar-total strong {
  font-size: 1.2rem;
}

html[data-portal='spotify'] .mobile-bar-btn {
  min-height: 44px;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

html[data-portal='spotify'] .mobile-bar-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

html[data-portal='spotify'] body.has-mobile-bar {
  padding-bottom: 80px;
}

@media (min-width: 901px) {
  html[data-portal='spotify'] .mobile-bar {
    display: none !important;
  }
}

@media (max-width: 600px) {
  html[data-portal='spotify'] .header h1 {
    font-size: 1.9rem;
  }

  html[data-portal='spotify'] .portal-nav {
    margin-bottom: 24px;
  }
}

/* ── Success page: green buttons carry black text, like the site's ── */
html[data-portal='spotify'] .btn:not(.btn-secondary) {
  color: #000;
  border-radius: 999px;
}

html[data-portal='spotify'] .btn-secondary {
  border-radius: 999px;
}

html[data-portal='spotify'] .copy-btn {
  border-radius: 999px;
}

html[data-portal='spotify'] .highlight {
  background: rgba(30, 215, 96, 0.06);
  border-color: rgba(30, 215, 96, 0.35);
}

/* ── Free trial (shown only while /api/config offers one) ── */
html[data-portal='spotify'] .portal-below {
  display: grid;
  gap: 24px;
}

html[data-portal='spotify'] .portal-trial p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

html[data-portal='spotify'] .trial-row {
  display: flex;
  gap: 10px;
}

html[data-portal='spotify'] .trial-row .form-input {
  flex: 1;
  min-width: 0;
}

html[data-portal='spotify'] .trial-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

html[data-portal='spotify'] .trial-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

html[data-portal='spotify'] .trial-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The honeypot: off-screen, out of the tab order, never seen. */
html[data-portal='spotify'] .trial-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

html[data-portal='spotify'] .header .portal-trial-link {
  margin-top: 8px;
  font-size: 0.95rem;
}

html[data-portal='spotify'] .header .portal-trial-link a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 600px) {
  html[data-portal='spotify'] .trial-row {
    flex-direction: column;
  }
}
