/* SmartRefresh platform — app shell styles (built on the site design tokens). */

/* ── Auth pages (login / signup) ────────────────────────────────────────── */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 100px 20px 40px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .bezel-core { padding: 36px 32px; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head .brand { justify-content: center; margin-bottom: 22px; font-size: 17px; }
.auth-head h1 { font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.auth-head p { color: var(--text-secondary); font-size: 14.5px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border-medium);
  color: var(--text-primary); font-family: var(--font-sans); font-size: 15px;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.field input::placeholder { color: var(--text-muted); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field input:user-invalid { border-color: var(--danger); }

.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; padding-left: 22px; padding-right: 22px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }
.auth-alt a { color: var(--accent-bright); font-weight: 500; }
.form-error {
  display: none; margin-bottom: 16px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: rgba(224,82,82,0.10); border: 1px solid rgba(224,82,82,0.28);
  color: #f0a3a3; font-size: 13.5px;
}
.form-error.show { display: block; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ── App shell (dashboard / account / billing) ──────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  /* Align the bar's content with the centered .app-main column (max 960px). */
  padding: 14px max(24px, calc((100% - 960px) / 2)); border-bottom: 1px solid var(--border);
  background: rgba(10,14,19,0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.appbar-nav { display: flex; gap: 4px; }
.appbar-nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: color 0.18s, background 0.18s;
}
.appbar-nav a:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.appbar-nav a.active { color: var(--accent-bright); background: var(--accent-dim); }
.appbar-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--accent-border);
  color: var(--accent-bright); display: grid; place-items: center;
  font-weight: 600; font-size: 14px; font-family: var(--font-mono);
}
.app-main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 40px 24px 64px; }
.app-h1 { font-size: 28px; font-weight: 600; margin-bottom: 6px; }
.app-sub { color: var(--text-secondary); font-size: 15px; margin-bottom: 32px; }

.plan-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
}
.plan-pill.free { background: rgba(255,255,255,0.06); border: 1px solid var(--border-medium); color: var(--text-secondary); }
.plan-pill.pro, .plan-pill.team { background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent-bright); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { padding: 20px 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); }
.stat .label { font-size: 12.5px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.stat .value { font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--text-primary); letter-spacing: -1px; }
.stat .value.accent { color: var(--accent-bright); }

/* Session list (dashboard) */
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 16px; font-weight: 600; }
.session { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.session:last-child { border-bottom: none; }
.session-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--bg-input); border: 1px solid var(--border-medium); display: grid; place-items: center; color: var(--accent-bright); flex-shrink: 0; }
.session-ico svg { width: 17px; height: 17px; }
.session-meta { flex: 1; min-width: 0; }
.session-meta .title { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-meta .url { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-count { font-family: var(--font-mono); font-size: 15px; color: var(--accent-bright); }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state svg { width: 38px; height: 38px; color: var(--text-muted); margin: 0 auto 14px; }
.empty-state p { color: var(--text-secondary); font-size: 14.5px; }
.empty-state .hint { margin-top: 6px; }

/* Account / billing forms */
.card-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 26px 26px; margin-bottom: 20px; }
.card-block h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card-block .desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 200px; }
.key-display {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border-medium);
  font-family: var(--font-mono); font-size: 14px; color: var(--accent-bright); word-break: break-all;
}
.key-display button { color: var(--text-secondary); font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--border-medium); flex-shrink: 0; }
.key-display button:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-box { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-surface); display: flex; flex-direction: column; gap: 6px; }
.plan-box.current { border-color: var(--accent-border); background: linear-gradient(165deg, var(--bg-card), rgba(29,158,117,0.04)); }
.plan-box .pname { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.plan-box .pprice { font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: -1px; margin: 2px 0 4px; }
.plan-box .pprice span { font-size: 13px; color: var(--text-muted); }
.plan-box .btn { margin-top: 14px; width: 100%; justify-content: center; }
.current-tag { font-family: var(--font-mono); font-size: 10px; color: var(--accent-bright); text-transform: uppercase; letter-spacing: 0.1em; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--accent-border); color: var(--text-primary);
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4); opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-fluid); z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  /* Wrap the nav onto its own full-width row so the bar never overflows. */
  .appbar { flex-wrap: wrap; padding: 10px 16px; row-gap: 10px; }
  .appbar .brand { order: 1; }
  .appbar-right { order: 2; }
  .appbar-nav {
    order: 3; width: 100%; justify-content: center;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px;
  }
  .appbar-nav a { padding: 8px 14px; font-size: 13px; flex: 1; text-align: center; }
  .app-main { padding: 28px 16px 48px; }
  .auth-card .bezel-core { padding: 28px 22px; }
}
