/*
 * portal.css — customer-portal styles on top of shared_lib's tokens.css.
 * Customer-facing surface; more polished + spacious than admin chrome.
 */

/* Header ------------------------------------------------------------------ */
.hg-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.hg-portal-header__brand     { display: flex; align-items: baseline; gap: 16px; }
.hg-portal-header__wordmark  { color: var(--ink-0); text-decoration: none; font-weight: 800;
                               letter-spacing: .2em; font-size: 18px; }
.hg-portal-header__subtitle  { font-family: var(--font-mono); font-size: 10px;
                               color: var(--fg-4); letter-spacing: .14em; }

.hg-portal-header__nav       { display: flex; gap: 28px; }
.hg-portal-header__nav-link  { color: var(--fg-3); text-decoration: none;
                               font-size: 13px; font-weight: 500; padding: 4px 0;
                               border-bottom: 2px solid transparent; }
.hg-portal-header__nav-link:hover { color: var(--ink-0); border-bottom-color: var(--hg-red); }

.hg-portal-header__actor       { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--fg-3); }
.hg-portal-header__actor-email { color: var(--ink-1); }
.hg-portal-header__actor-org   { color: var(--fg-4); border-left: 1px solid var(--line); padding-left: 14px; }
.hg-portal-header__signout     { color: var(--hg-red); text-decoration: none; font-weight: 600;
                                 font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
                                 border-left: 1px solid var(--line); padding-left: 14px; }
.hg-portal-header__signout:hover { color: var(--hg-red-700); }

/* Main + footer ----------------------------------------------------------- */
.hg-portal-main   { padding: 40px 32px; max-width: 1080px; margin: 0 auto; }
.hg-portal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--fg-4);
  margin-top: 80px;
}
.hg-portal-footer a { color: var(--fg-3); text-decoration: none; }
.hg-portal-footer a:hover { color: var(--ink-0); }

/* Page head --------------------------------------------------------------- */
.hg-portal-page-head { margin-bottom: 28px; }
.hg-portal-page-head .t-h1 { margin: 6px 0 8px; }

/* Sign-in surface --------------------------------------------------------- */
.hg-portal-signin             { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px;
                                align-items: start; max-width: 980px; margin: 64px auto 0; }
.hg-portal-signin__hero       { padding-top: 8px; }
.hg-portal-signin__card       { background: var(--surface); border: 1px solid var(--line);
                                border-radius: var(--radius-3); padding: 28px;
                                box-shadow: var(--shadow-2); }
.hg-portal-signin__providers  { display: flex; flex-direction: column; gap: 10px; }
.hg-portal-signin__divider    { display: flex; align-items: center; margin: 18px 0;
                                font-family: var(--font-mono); font-size: 10px;
                                letter-spacing: .12em; text-transform: uppercase;
                                color: var(--fg-4); }
.hg-portal-signin__divider::before,
.hg-portal-signin__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hg-portal-signin__divider span   { padding: 0 12px; }
.hg-portal-signin__local-dev      { background: var(--gain-50); padding: 12px; border-radius: var(--radius-2);
                                    border: 1px solid var(--line); }

@media (max-width: 760px) {
  .hg-portal-signin { grid-template-columns: 1fr; gap: 32px; padding: 0 24px; }
}

/* Onboarding nudge (zero-call accounts) ----------------------------------- */
.hg-portal-onboard {
  border: 1px solid var(--hg-red);
  background: var(--hg-red-50);
  border-radius: var(--radius-3);
  padding: 24px 28px;
  margin-bottom: 32px;
}
.hg-portal-code {
  background: var(--ink-0);
  color: #fff;
  padding: 14px 16px;
  border-radius: var(--radius-2);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  margin: 12px 0;
}

/* Stat tiles -------------------------------------------------------------- */
.hg-portal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.hg-portal-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  padding: 20px 24px;
  box-shadow: var(--shadow-1);
}

/* Section under the stats ------------------------------------------------- */
.hg-portal-section { margin-top: 32px; }

/* Card / table / status / pill / btn — inherit the rest from shared_lib's
   admin.css patterns. Define the overlap explicitly so portal works
   without admin.css. ----------------------------------------------------- */

.hg-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  padding: 24px 28px;
  box-shadow: var(--shadow-1);
}

.hg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hg-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
}
.hg-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-1);
}
.hg-table tr:hover td { background: var(--surface-2); }
.hg-table tr:last-child td { border-bottom: 0; }

.hg-status {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 2px;
}
.hg-status--active  { background: var(--gain-50); color: var(--gain); }
.hg-status--trial   { background: var(--hg-blue-50); color: var(--hg-blue-700); }
.hg-status--paused  { background: var(--ink-8); color: var(--ink-4); }
.hg-status--churned { background: var(--hg-red-50); color: var(--hg-red-700); }

.hg-dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}
.hg-dl dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-top: 4px;
}
.hg-dl dd { margin: 0; color: var(--fg-1); }

.hg-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }
.hg-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.hg-section__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}

.hg-plaintext {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-2);
  padding: 14px 16px;
  word-break: break-all;
  user-select: all;
  transition: filter 200ms ease;
}
.hg-plaintext.is-blurred { filter: blur(8px); cursor: pointer; }

.hg-input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-2);
  background: var(--paper);
  color: var(--ink-1);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
}
.hg-input:focus { border-color: var(--hg-blue); }
.hg-input--lg { height: 46px; font-size: 15px; }

.hg-form { display: flex; flex-direction: column; gap: 14px; }
.hg-form__field { display: flex; flex-direction: column; gap: 6px; }
.hg-form__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.hg-form__hint { font-size: 11px; color: var(--fg-4); }
.hg-form__actions { display: flex; gap: 10px; margin-top: 8px; }
