/**
 * Darkframe Hub — dfh-frontend.css
 *
 * Shared frontend styles for all [dfh_*] shortcodes except [dfh_login]
 * (which uses auth.css). These are intentionally minimal and unopinionated
 * so Mosaic / the active theme can override them freely.
 *
 * CSS custom properties are scoped to the .dfh-* root elements, making
 * per-shortcode theming straightforward.
 */

/* ── Base variables (shared) ──────────────────────────────────────────────── */

:root {
  --dfh-color-primary:        #e95d6b;
  --dfh-color-primary-hover:  #d44555;
  --dfh-color-text:           #1a1a1a;
  --dfh-color-muted:          #6b7280;
  --dfh-color-border:         #e5e7eb;
  --dfh-color-bg:             #ffffff;
  --dfh-color-bg-subtle:      #f9fafb;
  --dfh-color-success-bg:     #f0fdf4;
  --dfh-color-success-text:   #166534;
  --dfh-color-error-bg:       #fef2f2;
  --dfh-color-error-text:     #991b1b;
  --dfh-color-warning-bg:     #fffbeb;
  --dfh-color-warning-text:   #92400e;
  --dfh-radius:               6px;
  --dfh-font-size:            15px;
  --dfh-shadow:               0 1px 3px rgba(0,0,0,.08);
}

/* ── Shared utilities ─────────────────────────────────────────────────────── */

.dfh-notice {
  padding: 12px 16px;
  border-radius: var(--dfh-radius);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.dfh-notice--success {
  background: var(--dfh-color-success-bg);
  color:      var(--dfh-color-success-text);
}

.dfh-notice--error {
  background: var(--dfh-color-error-bg);
  color:      var(--dfh-color-error-text);
}

.dfh-notice--warning {
  background: var(--dfh-color-warning-bg);
  color:      var(--dfh-color-warning-text);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.dfh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--dfh-radius);
  font-size: var(--dfh-font-size);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.dfh-btn--primary {
  background: var(--dfh-color-primary);
  color: #fff;
}

.dfh-btn--primary:hover {
  background: var(--dfh-color-primary-hover);
  color: #fff;
}

.dfh-btn--secondary {
  background: var(--dfh-color-bg-subtle);
  color: var(--dfh-color-text);
  border: 1px solid var(--dfh-color-border);
}

.dfh-btn--secondary:hover {
  background: var(--dfh-color-border);
}

.dfh-btn--full {
  width: 100%;
}

.dfh-btn--sm {
  padding: 6px 14px;
  font-size: 13px;
}

.dfh-btn:disabled,
.dfh-btn[aria-busy="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */

.dfh-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.dfh-badge--green  { background: #dcfce7; color: #166534; }
.dfh-badge--amber  { background: #fef3c7; color: #92400e; }
.dfh-badge--red    { background: #fee2e2; color: #991b1b; }
.dfh-badge--grey   { background: #f3f4f6; color: #374151; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */

.dfh-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--dfh-color-border);
  border-top-color: var(--dfh-color-primary);
  border-radius: 50%;
  animation: dfh-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes dfh-spin {
  to { transform: rotate(360deg); }
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.dfh-table-wrap {
  overflow-x: auto;
}

.dfh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.dfh-table th,
.dfh-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--dfh-color-border);
}

.dfh-table th {
  font-weight: 600;
  color: var(--dfh-color-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dfh-table tr:last-child td {
  border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   [dfh_account]
   ═══════════════════════════════════════════════════════════════════════════ */

.dfh-account {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: var(--dfh-font-size);
  color: var(--dfh-color-text);
}

.dfh-account__header {
  padding-bottom: 4px;
}

.dfh-account__welcome {
  margin: 0;
  font-size: 18px;
}

.dfh-account__card {
  background: var(--dfh-color-bg);
  border: 1px solid var(--dfh-color-border);
  border-radius: var(--dfh-radius);
  padding: 24px;
  box-shadow: var(--dfh-shadow);
}

.dfh-account__card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dfh-color-border);
}

.dfh-account__membership-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dfh-account__plan-name {
  font-size: 17px;
  font-weight: 600;
}

.dfh-account__renewal {
  font-size: 14px;
  color: var(--dfh-color-muted);
  margin: 0 0 16px;
}

.dfh-account__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dfh-account__all-access {
  margin: 0;
  color: var(--dfh-color-muted);
  font-size: 14px;
}

.dfh-account__game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dfh-account__game-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dfh-account__game-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.dfh-account__game-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   [dfh_checkout]
   ═══════════════════════════════════════════════════════════════════════════ */

.dfh-checkout-wrap {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  font-size: var(--dfh-font-size);
  color: var(--dfh-color-text);
}

.dfh-checkout-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dfh-checkout-state--loading .dfh-spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   [dfh_pricing]
   ═══════════════════════════════════════════════════════════════════════════ */

.dfh-pricing {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
  .dfh-pricing--cols-2 { grid-template-columns: repeat(2, 1fr); }
  .dfh-pricing--cols-3 { grid-template-columns: repeat(3, 1fr); }
  .dfh-pricing--cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.dfh-pricing__card {
  position: relative;
  background: var(--dfh-color-bg);
  border: 1px solid var(--dfh-color-border);
  border-radius: var(--dfh-radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--dfh-shadow);
  transition: box-shadow 0.15s;
}

.dfh-pricing__card--featured {
  border-color: var(--dfh-color-primary);
  box-shadow: 0 0 0 2px var(--dfh-color-primary), var(--dfh-shadow);
}

.dfh-pricing__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dfh-color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.dfh-pricing__plan-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.dfh-pricing__description {
  font-size: 14px;
  color: var(--dfh-color-muted);
  margin: 0;
  line-height: 1.6;
}

.dfh-pricing__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dfh-pricing__cta {
  margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   [dfh_games]
   ═══════════════════════════════════════════════════════════════════════════ */

.dfh-games {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
  .dfh-games {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .dfh-games {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dfh-games__card {
  background: var(--dfh-color-bg);
  border: 1px solid var(--dfh-color-border);
  border-radius: var(--dfh-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--dfh-shadow);
  transition: box-shadow 0.15s;
}

.dfh-games__card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.dfh-games__logo-wrap {
  aspect-ratio: 16 / 9;
  background: var(--dfh-color-bg-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dfh-games__logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dfh-games__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dfh-games__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.dfh-games__description {
  font-size: 14px;
  color: var(--dfh-color-muted);
  margin: 0;
  line-height: 1.6;
}

.dfh-games__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--dfh-color-border);
}
