/* Fablun Free Growth v3 Prod Eager Console Stylesheet
   Covers Sign-in clean twin OAuth stack (40px Google + 40px GitHub, zero badges),
   Dashboard Cinema Hero + balance subline, Playground 2-path upgrade card,
   and Mobile API Keys (<=720px) responsive fix. Light + Dark parity. */

/* 1. Sign-in Page Clean OAuth Stack (Google + GitHub, zero badges, exact 40px twin height) */
.cc-signin .cc-unified-login .cc-oauth-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0 0;
  width: 100%;
  max-width: 400px;
}
.cc-signin .cc-unified-login .cc-oauth-slot {
  position: relative;
  width: 100%;
}
.cc-signin .cc-unified-login .cc-oauth-slot .p-google-button {
  margin: 0 !important;
  width: 100%;
  min-height: 40px;
}
.cc-signin .cc-unified-login .cc-oauth-slot .p-google-button:empty {
  min-height: 0;
}
.cc-signin .cc-unified-login .cc-oauth-slot:has(.p-google-button:empty) {
  margin-bottom: -10px;
}
.cc-signin .cc-unified-login .cc-github-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #1f2328 !important;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.cc-signin .cc-unified-login .cc-github-btn:hover {
  background: #f6f8fa;
  border-color: #c5cbd3;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  text-decoration: none !important;
}
.cc-signin .cc-unified-login .cc-github-btn:focus-visible {
  outline: 2px solid #0b0d12;
  outline-offset: 2px;
}
.cc-signin .cc-unified-login .cc-github-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* 2. Console Dashboard Cinematic Free-Tier Hero Banner */
#root .p-console.p-customer .studio-dashboard .hm-free-hero {
  position: relative;
  margin: 0 0 20px;
  min-height: 164px;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0c12;
  border: 1px solid rgba(15, 18, 28, 0.14);
  box-shadow: 0 12px 30px rgba(10, 12, 20, 0.14);
  display: flex;
  align-items: center;
  padding: 26px 32px;
  color: #ffffff;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 3;
  background: linear-gradient(
    90deg,
    transparent 4%,
    rgba(124, 196, 255, 0.62) 28%,
    rgba(198, 180, 255, 0.64) 55%,
    rgba(246, 210, 155, 0.44) 80%,
    transparent 96%
  );
  pointer-events: none;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 36%;
  z-index: 0;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(94deg, rgba(10, 12, 18, 0.95) 0%, rgba(10, 12, 18, 0.88) 46%, rgba(10, 12, 18, 0.42) 74%, rgba(10, 12, 18, 0.16) 100%),
    linear-gradient(180deg, rgba(10, 12, 18, 0.16) 0%, rgba(10, 12, 18, 0.42) 100%);
  pointer-events: none;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 12, 18, 0.48);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.72);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-close:hover {
  color: #ffffff;
  background: rgba(10, 12, 18, 0.78);
  border-color: rgba(255, 255, 255, 0.34);
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-body {
  position: relative;
  z-index: 2;
  max-width: 580px;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-body h2 {
  margin: 0 !important;
  font-size: 22px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.025em !important;
  font-weight: 650 !important;
  color: #ffffff !important;
  font-variant-numeric: tabular-nums;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-body p {
  margin: 7px 0 0 !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  color: rgba(226, 232, 245, 0.82) !important;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #0b0d12;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 150ms ease, background-color 150ms ease;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-primary:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
#root .p-console.p-customer .studio-dashboard .hm-free-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.44);
}
#root .p-console.p-customer .studio-dashboard .hm-balance-sub {
  margin: -4px 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #6b7280;
}
#root .p-console.p-customer .studio-dashboard .hm-balance-sub.is-low {
  color: #b45309;
  font-weight: 500;
}

/* 3. Playground Contextual Free-Tier 2-Path Upgrade Card */
.upg-free-upsell {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.28);
  background: rgba(254, 243, 199, 0.34);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.upg-free-upsell-title {
  font-size: 13px;
  font-weight: 650;
  color: #18181b;
}
.upg-free-upsell-copy {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #52525b;
}
.upg-free-upsell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.upg-free-upsell-actions .pa-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* 4. Dark Mode Parity */
html[data-preview-theme="dark"] #root .p-console.p-customer .studio-dashboard .hm-free-hero {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36);
}
html[data-preview-theme="dark"] #root .p-console.p-customer .studio-dashboard .hm-balance-sub {
  color: var(--night-muted) !important;
}
html[data-preview-theme="dark"] #root .p-console.p-customer .studio-dashboard .hm-balance-sub.is-low {
  color: #fbbf24 !important;
}
html[data-preview-theme="dark"] .upg-free-upsell {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
}
html[data-preview-theme="dark"] .upg-free-upsell-title {
  color: #f4f4f5;
}
html[data-preview-theme="dark"] .upg-free-upsell-copy {
  color: #a1a1aa;
}

@media (max-width: 760px) {
  .cc-signin .cc-unified-login .cc-oauth-stack {
    margin-top: 16px;
  }
}

/* 5. Mobile Console API Keys Layout Polish (<=720px, iPhone 390px verified) */
@media (max-width: 720px) {
  #root .p-console.p-customer .studio-dashboard .hm-free-hero {
    padding: 22px 20px;
  }
  #root .p-console.p-customer .pa-keys .pa-page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
  }
  #root .p-console.p-customer .pa-keys .pa-page-heading > button {
    max-width: none !important;
    width: auto;
    white-space: nowrap !important;
    padding: 6px 11px;
  }
  #root .p-console.p-customer .pa-keys .pa-credit-callout {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 16px;
    margin-bottom: 16px;
  }
  #root .p-console.p-customer .pa-keys .pa-credit-callout > div {
    flex: 1 1 calc(100% - 36px);
    min-width: 0;
  }
  #root .p-console.p-customer .pa-keys .pa-credit-callout > .pa-button {
    width: 100%;
    min-height: 38px;
    justify-content: center;
  }
  #root .p-console.p-customer .pa-keys .pa-permission-banner {
    align-items: flex-start;
    padding: 11px 14px;
    line-height: 1.55;
  }
  #root .p-console.p-customer .pa-keys .pa-permission-banner > svg {
    margin-top: 2px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-toolbar > .pa-primary {
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
  }
  #root .p-console.p-customer .pa-keys .pa-key-tools > span {
    margin-right: auto;
    font-size: 12px;
    white-space: nowrap;
  }
  #root .p-console.p-customer .pa-keys .pa-key-tools select,
  #root .p-console.p-customer .pa-keys .pa-key-tools .pa-button {
    min-width: 0 !important;
    min-height: 36px;
    height: 36px;
    padding: 0 12px;
    flex: 0 0 auto;
  }
  #root .p-console.p-customer .pa-keys .pa-table-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
  #root .p-console.p-customer .pa-keys .pa-key-table {
    min-width: 780px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-table th,
  #root .p-console.p-customer .pa-keys .pa-key-table td {
    padding: 12px 10px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-table th:first-child,
  #root .p-console.p-customer .pa-keys .pa-key-table td:first-child {
    padding-left: 14px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-table th:last-child,
  #root .p-console.p-customer .pa-keys .pa-key-table td:last-child {
    padding-right: 14px;
  }
  #root .p-console.p-customer .pa-keys .pa-key-table:has(.pa-empty) {
    min-width: 100% !important;
  }
  #root .p-console.p-customer .pa-keys .pa-key-table:has(.pa-empty) thead {
    display: none;
  }
  #root .p-console.p-customer .pa-keys .pa-empty {
    padding: 28px 16px !important;
    white-space: normal;
  }
  #root .p-console.p-customer .pa-keys .pa-table-hint {
    flex-wrap: wrap;
    line-height: 1.55;
  }
}
