/* Colli account portal — brand-matched dark theme */

@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/Satoshi-Regular.woff2') format('woff2'), url('/fonts/Satoshi-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/Satoshi-Medium.woff2') format('woff2'), url('/fonts/Satoshi-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/Satoshi-Bold.woff2') format('woff2'), url('/fonts/Satoshi-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ─────────────────────────────────── */
:root {
  --canvas:   #211c1e;
  --panel:    #1f1f24;
  --ink:      #f7f2eb;
  --muted:    #b8ada8;
  --pulse:    #66ebff;
  --glass:    0 24px 80px rgba(0, 0, 0, 0.36);
  --radius:   12px;
  --radius-sm: 6px;
}

/* ── Reset / base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--pulse); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Shell ─────────────────────────────────────────── */
.portal-header {
  padding: 20px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.portal-brand:hover { text-decoration: none; }

.portal-logo {
  height: 28px;
  width: auto;
  display: block;
}

.portal-brand-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.portal-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
}

.portal-footer {
  padding: 20px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.portal-footer p { margin: 0; }

/* ── Cards ─────────────────────────────────────────── */
.portal-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--glass);
  padding: 40px 44px;
  width: 100%;
  max-width: 680px;
}

.portal-card--narrow {
  max-width: 420px;
}

.portal-card--center {
  text-align: center;
}

/* ── Typography ────────────────────────────────────── */
.portal-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.portal-subheading {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.portal-email {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 28px;
}

.portal-muted {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0;
}

.portal-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* ── Sections ──────────────────────────────────────── */
.portal-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Forms ─────────────────────────────────────────── */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.portal-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}

.portal-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.portal-input:focus {
  border-color: var(--pulse);
  box-shadow: 0 0 0 3px rgba(102, 235, 255, 0.10);
}

.portal-input::placeholder { color: rgba(248,242,235,0.25); }

/* ── Buttons ───────────────────────────────────────── */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}

.portal-btn--primary {
  background: var(--pulse);
  color: #0d0d0f;
  width: 100%;
  margin-top: 8px;
}

.portal-btn--primary:hover { opacity: 0.88; }

.portal-btn--secondary {
  background: rgba(255,255,255,0.07);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.10);
}

.portal-btn--secondary:hover { background: rgba(255,255,255,0.11); }

/* ── Web OAuth buttons ─────────────────────────────── */
.portal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.portal-divider::before,
.portal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.10);
}

.portal-oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-btn--oauth {
  background: rgba(255,255,255,0.07);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.10);
  width: 100%;
  gap: 10px;
}

.portal-btn--oauth:hover { background: rgba(255,255,255,0.11); }

.portal-oauth-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Wrapping spans exist only so the Glob look (glob.css) can lay the icon and
   label out in a fixed-width grid; in the Colli look they must stay inert. */
.portal-oauth-row,
.portal-oauth-icon-wrap {
  display: contents;
}

.portal-btn--link-provider {
  width: auto;
  margin-top: 10px;
  margin-right: 8px;
  padding: 8px 16px;
  font-size: 14px;
}

.portal-btn--destructive {
  background: rgba(255, 70, 70, 0.12);
  color: #ff6b6b;
  border: 1px solid rgba(255,70,70,0.20);
  padding: 6px 14px;
  font-size: 13px;
}

.portal-btn--destructive:hover { background: rgba(255,70,70,0.20); }

/* ── Alerts ────────────────────────────────────────── */
.portal-alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 4px;
}

.portal-alert--error {
  background: rgba(255, 70, 70, 0.10);
  border: 1px solid rgba(255, 70, 70, 0.20);
  color: #ff8f8f;
}

.portal-alert--success {
  background: rgba(102, 235, 255, 0.08);
  border: 1px solid rgba(102, 235, 255, 0.18);
  color: var(--pulse);
}

/* ── Account settings ─────────────────────────────── */
.portal-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.portal-avatar {
  width: 72px;
  height: 72px;
  flex: none;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%;
  background: var(--panel);
  object-fit: cover;
}

.portal-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
}

.portal-profile-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.portal-plan-badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: rgba(102, 235, 255, 0.12);
  color: var(--pulse);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.portal-plan-badge--muted {
  background: rgba(255,255,255,0.07);
  color: var(--muted);
}

.portal-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.portal-file-input:focus + label {
  outline: 2px solid var(--pulse);
  outline-offset: 2px;
}

.portal-btn--tiny {
  padding: 6px 12px;
  font-size: 13px;
}

.portal-usage-windows {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.portal-usage-window {
  flex: none;
  padding: 4px 0 6px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.portal-usage-window:hover {
  color: var(--ink);
  text-decoration: none;
}

.portal-usage-window.is-active {
  border-bottom-color: var(--pulse);
  color: var(--ink);
}

.portal-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.portal-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.portal-stat-value {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.portal-stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-credits {
  border-left: 3px solid var(--pulse);
}

.portal-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

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

.portal-model-table th,
.portal-model-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}

.portal-model-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-model-table td {
  color: var(--ink);
}

.portal-model-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Links row ─────────────────────────────────────── */
.portal-links {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.portal-link {
  font-size: 14px;
  color: var(--pulse);
}

/* ── Session list ──────────────────────────────────── */
.portal-session-list,
.portal-identity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  gap: 16px;
}

.portal-session-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.portal-session-device {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-session-meta {
  font-size: 12px;
  color: var(--muted);
}

.portal-session-row form {
  flex-shrink: 0;
}

/* ── Identity list ─────────────────────────────────── */
.portal-identity-row {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.portal-identity-row:last-child { border-bottom: none; }

.portal-identity-provider {
  font-weight: 600;
  color: var(--pulse);
  text-transform: capitalize;
  min-width: 60px;
}

.portal-identity-subject { color: var(--muted); font-size: 13px; }

/* ── Sign-out form ─────────────────────────────────── */
.portal-signout {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Usage section header — title left, window tabs right */
.portal-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.portal-section-head .portal-subheading { margin: 0; }
.portal-avatar-form { display: inline-flex; }

/* Usage sparkline — daily request volume, normalised to the busiest day */
.portal-sparkline-wrap {
  margin: 14px 0 4px;
}
.portal-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  padding: 4px 0;
}
.portal-spark-bar {
  flex: 1 1 0;
  min-width: 2px;
  min-height: 2px;
  background: var(--pulse);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}
.portal-spark-bar:hover { opacity: 1; }
.portal-spark-bar--zero {
  height: 2px;
  background: rgba(255,255,255,0.12);
  align-self: flex-end;
}
.portal-sparkline-wrap .portal-stat-label { display: block; margin-top: 4px; }
