/* platform.css — Platform-specific styles only
   Load after bc-tokens.css and biz-catalyst-core.css */


/* ── Page background: warm cream override ───────────────────── */

:root {
  --bc-page-bg: #fdf9f3;
}

body {
  background-color: #fdf9f3;
}


/* ── Auth layout ─────────────────────────────────────────────── */

.bc-auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: var(--bc-page-bg, #fdf9f3);
}

.bc-auth-container {
  width: 100%;
  max-width: 400px;
}

.bc-auth-container--wide { max-width: 440px; }

.bc-auth-card {
  background: var(--bc-surface);
  border-radius: var(--bc-radius-lg);
  padding: 2rem;
  box-shadow: var(--bc-shadow-md);
  border: 1px solid var(--bc-border);
}

.bc-auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.bc-auth-logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bc-brand-primary);
  margin-bottom: 0.5rem;
}

.bc-auth-subtitle {
  color: var(--bc-text-muted);
  font-size: 0.9375rem;
}


/* ── Form label (alias for bc-label, used throughout platform) ── */

.bc-form-label {
  font-size: var(--bc-font-size-sm);
  font-weight: var(--bc-font-weight-medium);
  color: var(--bc-text);
}


/* ── Card body (semantic wrapper inside bc-card) ─────────────── */

.bc-card__body { /* padding comes from .bc-card itself */ }


/* ── Table (not in core, platform adds its own table system) ──── */

.bc-table-wrapper {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.bc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.bc-table th,
.bc-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--bc-border);
}

.bc-table th {
  font-weight: 600;
  color: var(--bc-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bc-surface-raised, var(--bc-bg));
}

.bc-table tbody tr:hover {
  background: var(--bc-surface-raised, var(--bc-bg));
}


/* ── App grid (dashboard) ────────────────────────────────────── */

.pt-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.pt-app-card {
  background: var(--bc-surface);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow var(--bc-duration-fast, 150ms) ease;
}

.pt-app-card:hover { box-shadow: var(--bc-shadow-md); }

.pt-app-card__icon {
  font-size: 2rem;
  line-height: 1;
}

.pt-app-card__name {
  font-weight: 600;
  font-size: 1.0625rem;
}

.app-description {
  font-size: 0.875rem;
  color: var(--bc-text-muted);
  flex: 1;
}

.pt-suggest-card {
  border: 2px dashed var(--bc-border);
  border-radius: var(--bc-radius-lg);
  padding: 1.5rem;
  text-align: center;
  color: var(--bc-text-muted);
}

/* Lightbulb special card */
.lightbulb-special {
  border: 2px dashed var(--bc-brand-primary);
  background: var(--bc-surface-raised, #f0f7ff);
}

.lightbulb-icon {
  background: var(--bc-warning-light, #fef3c7);
}

.lightbulb-special .rewards-info {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bc-surface);
  border-radius: var(--bc-radius-sm);
}

.lightbulb-special .rewards-info small {
  line-height: 1.8;
  color: var(--bc-text-muted);
  font-size: 0.8125rem;
}


/* ── Info rows (account page key-value display) ──────────────── */

.pt-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--bc-border);
}

.pt-info-row:last-child { border-bottom: none; }

.pt-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pt-info-value {
  font-size: 0.9375rem;
  color: var(--bc-text);
  font-weight: 500;
}


/* ── Card header with action (title + button row) ────────────── */

.bc-card__header--with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ── Key/code display ────────────────────────────────────────── */

.pt-key-display {
  background: var(--bc-bg, var(--bc-surface-raised));
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  padding: 0.75rem 1rem;
  cursor: pointer;
  margin: 1rem 0;
}

.pt-key-preview {
  font-family: var(--bc-font-mono);
  font-size: 0.875rem;
  word-break: break-all;
  color: var(--bc-text);
}


/* ── Info box (inside modals) ────────────────────────────────── */

.pt-info-box {
  background: var(--bc-bg, var(--bc-surface-raised));
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
}

.pt-info-box__title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.pt-info-box ol {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.8;
  color: var(--bc-text);
}


/* ── Form section divider ────────────────────────────────────── */

.pt-form-section-divider {
  border-top: 1px solid var(--bc-border);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}


/* ── Registration: subdomain field ──────────────────────────── */

.pt-subdomain-row {
  display: flex;
  align-items: stretch;
}

.pt-subdomain-row input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  flex: 1;
}

.pt-subdomain-suffix {
  background: var(--bc-bg, var(--bc-surface-raised));
  border: 1px solid var(--bc-border);
  border-left: none;
  border-top-right-radius: var(--bc-radius);
  border-bottom-right-radius: var(--bc-radius);
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--bc-text-muted);
  white-space: nowrap;
}

.pt-subdomain-status {
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  min-height: 1rem;
}

.pt-subdomain-status--available { color: var(--bc-success); }
.pt-subdomain-status--unavailable { color: var(--bc-danger); }

.pt-subdomain-row.valid input { border-color: var(--bc-success); }
.pt-subdomain-row.valid .pt-subdomain-suffix { border-color: var(--bc-success); }
.pt-subdomain-row.invalid input { border-color: var(--bc-danger); }
.pt-subdomain-row.invalid .pt-subdomain-suffix { border-color: var(--bc-danger); }


/* ── Registration: password requirements ────────────────────── */

.pt-password-requirements {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pt-password-requirements li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--bc-text-muted);
}

.pt-password-requirements .check {
  display: inline-block;
  width: 1em;
  text-align: center;
}

.pt-password-requirements li.met { color: var(--bc-success); }
.pt-password-requirements li.unmet { color: var(--bc-danger); }


/* ── Registration: referral/app badge ───────────────────────── */

.pt-app-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--bc-primary-tint, #ede9fe);
  color: var(--bc-brand-primary);
  border-radius: var(--bc-radius-full, 9999px);
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}


/* ── Billing: tier cards ─────────────────────────────────────── */

.pt-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.pt-tier-card {
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bc-surface);
}

.pt-tier-card--popular {
  border-color: var(--bc-brand-primary);
  box-shadow: 0 0 0 2px var(--bc-brand-primary);
}

.pt-popular-badge {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bc-brand-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: var(--bc-radius-full, 9999px);
  white-space: nowrap;
}

.pt-tier-card__header { margin-bottom: 1rem; }
.pt-tier-card__name { font-weight: 700; font-size: 1.125rem; }
.pt-tier-card__price { font-size: 2rem; font-weight: 700; color: var(--bc-text); }
.pt-tier-card__price-period { font-size: 0.875rem; color: var(--bc-text-muted); }

.pt-tier-card__features {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.pt-tier-card__features li::before { content: '✓ '; color: var(--bc-success); }

.pt-tier-card__footer {
  margin-top: auto;
  padding-top: 1rem;
}


/* ── Billing: add-on stepper ─────────────────────────────────── */

.pt-stepper { display: inline-flex; align-items: center; gap: 0.5rem; }

.pt-stepper__btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  background: var(--bc-surface);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-stepper__btn:hover:not(:disabled) {
  border-color: var(--bc-brand-primary);
  color: var(--bc-brand-primary);
}

.pt-stepper__btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pt-stepper__count { min-width: 2rem; text-align: center; font-weight: 600; }


/* ── Success page ────────────────────────────────────────────── */

.pt-success-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.pt-success-container { text-align: center; max-width: 480px; }

.pt-success-icon {
  width: 80px;
  height: 80px;
  background: var(--bc-success-light, #d1fae5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.pt-success-icon svg { width: 40px; height: 40px; color: var(--bc-success); }

.pt-success-title { font-size: 1.75rem; font-weight: 600; margin-bottom: 0.75rem; }

.pt-success-message {
  color: var(--bc-text-muted);
  margin-bottom: 2rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.pt-success-actions { display: flex; flex-direction: column; gap: 0.75rem; }

.pt-redirect-note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--bc-text-muted);
}


/* ── Cancelled page ──────────────────────────────────────────── */

.pt-cancelled-icon {
  width: 80px;
  height: 80px;
  background: var(--bc-bg, #f9fafb);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  border: 2px solid var(--bc-border);
}

.pt-cancelled-icon svg { width: 40px; height: 40px; color: var(--bc-text-muted); }

.pt-help-note {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bc-bg, #f9fafb);
  border-radius: var(--bc-radius);
  font-size: 0.875rem;
  color: var(--bc-text-muted);
}

.pt-help-note a { color: var(--bc-brand-primary); text-decoration: none; }
.pt-help-note a:hover { text-decoration: underline; }


/* ── Settings-grid: pin card submit buttons to card bottom ────── */

.settings-grid .bc-card {
  display: flex;
  flex-direction: column;
}

.settings-grid .bc-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.settings-grid .bc-card form > button[type="submit"] {
  margin-top: auto;
}


/* ── Layout: structural classes still referenced in HTML ─────── */

.page-header { padding: 1.5rem 0 1rem; }

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bc-text);
  margin-bottom: 0.25rem;
}

.page-subtitle { color: var(--bc-text-muted); font-size: 0.9375rem; }

.apps-section { margin-bottom: 2rem; }

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--bc-text);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.full-width-section { margin-top: 1.5rem; }


/* ── Billing structural classes ──────────────────────────────── */

.billing-section { margin-bottom: 1.5rem; }

.pricing-hero { text-align: center; padding: 1.5rem 0; }
.pricing-hero h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }

.pricing-tiers { margin-bottom: 2rem; }

.pricing-transparency { margin-bottom: 2rem; }
.pricing-transparency h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }

.pricing-note { font-size: 0.8125rem; color: var(--bc-text-muted); margin-top: 0.75rem; }

.highlight-row { background: var(--bc-surface-raised, #f9fafb); }
.highlight-row td { font-weight: 600; }
.star { color: var(--bc-warning, #d97706); }

.tier-body { flex: 1; }

.tier-description { font-size: 0.875rem; color: var(--bc-text-muted); margin-bottom: 0.75rem; }

.tier-note { font-size: 0.8125rem; color: var(--bc-text-muted); font-style: italic; margin-top: 0.5rem; }

.addon-selector { margin-top: 1rem; border-top: 1px solid var(--bc-border); padding-top: 0.75rem; }
.addon-label { font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; display: block; }
.addon-price { font-size: 0.9375rem; margin-top: 0.5rem; }
.addon-breakdown { font-size: 0.8125rem; color: var(--bc-text-muted); font-weight: 400; }

.vat-notice { padding: 1rem 0; border-top: 1px solid var(--bc-border); }


/* ── API Keys section ────────────────────────────────────────── */

.link-group { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.link-btn { color: var(--bc-brand-primary); font-size: 0.875rem; }
.link-btn:hover { text-decoration: underline; }


/* ── Form controls in modals (checkbox, radio groups) ────────── */

.checkbox-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

.bc-checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.bc-checkbox-label input { width: 1rem; height: 1rem; cursor: pointer; }

.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.radio-inline { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.radio-inline select {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  background: var(--bc-surface);
}


/* ── Link-style button ───────────────────────────────────────── */

.bc-btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--bc-brand-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bc-btn-link:hover { text-decoration: none; }


/* ── Toast fade-out animation ────────────────────────────────── */

.bc-toast--fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}


/* ── Utility aliases still referenced in HTML/JS ─────────────── */

.text-muted { color: var(--bc-text-muted); }
.text-center { text-align: center; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.bc-mt-3 { margin-top: 1.5rem; }
.bc-mb-2 { margin-bottom: 1rem; }

@media (max-width: 640px) {
  .settings-grid { grid-template-columns: 1fr; }
  .pt-tier-grid { grid-template-columns: 1fr; }
  .checkbox-group { grid-template-columns: 1fr; }
  .pt-app-grid { grid-template-columns: 1fr; }
}
