/* Glance — shared stylesheet for auth/account/legal pages */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0c0c0d;
  --bg-card:     rgba(255,255,255,0.04);
  --bg-input:    rgba(255,255,255,0.06);
  --border:      rgba(255,255,255,0.09);
  --text:        #ffffff;
  --text-muted:  rgba(255,255,255,0.5);
  --text-subtle: rgba(255,255,255,0.3);
  --accent:      #ffffff;
  --accent-text: #000000;
  --green:       #4ade80;
  --red:         #f87171;
  --radius:      12px;
  --radius-btn:  999px;
  --font:        'DM Sans', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.75; }

/* ── Typography ─────────────────────────────────────────────────────────────── */

h1 { font-size: 2rem;    font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.5rem;  font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { line-height: 1.7; color: var(--text-muted); }

/* ── Nav ─────────────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(12,12,13,0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--text); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  outline: none;
}
.btn:hover  { opacity: 0.88; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-card); }
.btn-danger  { background: var(--red); color: #000; }

.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: rgba(255,255,255,0.3); }
input::placeholder { color: var(--text-subtle); }

/* ── Cards ───────────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-sm { padding: 16px 20px; }

/* ── Auth layout ─────────────────────────────────────────────────────────────── */

.auth-page {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-header { text-align: center; }
.auth-header p { margin-top: 8px; font-size: 0.9rem; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-footer { text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.auth-footer a { color: var(--text); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

.error-msg {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  color: var(--red);
  font-size: 0.85rem;
  padding: 10px 14px;
  display: none;
}
.error-msg.show { display: block; }

.success-msg {
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 8px;
  color: var(--green);
  font-size: 0.85rem;
  padding: 10px 14px;
  display: none;
}
.success-msg.show { display: block; }

/* ── Account page ────────────────────────────────────────────────────────────── */

.account-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.account-header h1 { font-size: 1.75rem; }
.account-header p  { margin-top: 6px; font-size: 0.9rem; }

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.plan-badge.active { border-color: rgba(74,222,128,0.35); color: var(--green); }
.plan-badge.trial  { border-color: var(--border); color: var(--text-muted); }

.key-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.key-display code {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text);
}
.key-copy {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 6px 14px;
}

.usage-bar-wrap {
  margin-top: 10px;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s;
}

/* ── Legal pages ─────────────────────────────────────────────────────────────── */

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.legal-page h1 { font-size: 2.25rem; }
.legal-meta { color: var(--text-subtle); font-size: 0.85rem; }

.legal-section { display: flex; flex-direction: column; gap: 10px; }
.legal-section h2 { color: var(--text); font-size: 1.15rem; }
.legal-section p  { font-size: 0.95rem; }

/* ── Misc utilities ──────────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--border);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.col { display: flex; flex-direction: column; gap: 4px; }

.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.75rem; }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.font-mono   { font-family: 'SF Mono', 'Fira Code', monospace; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* Google Fonts preload */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');
