:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-panel: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent2: #0ea5e9;
  --error: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --maxw: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.02em; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; box-shadow: 0 6px 14px -6px var(--accent); }
.brand .mark svg { width: 17px; height: 17px; color: #fff; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); color: #fff; box-shadow: 0 8px 18px -8px var(--accent); }
.btn-primary:hover { transform: translateY(-1px); color: #fff; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

/* ---- hero ---- */
.hero { padding: 96px 0 72px; text-align: center; background: radial-gradient(900px 500px at 50% -10%, #eef2ff 0%, transparent 60%); }
.hero .pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted); background: #fff; margin-bottom: 26px; }
.hero .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; max-width: 760px; margin: 0 auto 20px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 19px; color: var(--muted); max-width: 600px; margin: 0 auto 34px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- sections ---- */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head h2 { font-size: 32px; letter-spacing: -0.02em; font-weight: 700; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card .ico { width: 44px; height: 44px; border-radius: 11px; background: var(--bg-panel); display: grid; place-items: center; margin-bottom: 16px; color: var(--accent); }
.card .ico svg { width: 22px; height: 22px; }
.card h3 { font-size: 18px; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 15px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; text-align: center; }
.metrics .m .n { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metrics .m .l { color: var(--muted); font-size: 15px; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--border); padding: 48px 0 36px; color: var(--muted); font-size: 14px; }
.footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.footer .col h4 { color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 14px; }
.footer .col a { display: block; color: var(--muted); margin-bottom: 9px; font-size: 14px; }
.footer .col a:hover { color: var(--text); }
.footer .bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---- auth card (login) ---- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 24px; background: radial-gradient(700px 400px at 50% 0%, #eef2ff 0%, transparent 60%); }
.auth-card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 38px 34px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 23px; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; }
.field input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin: 4px 0 22px; }
.row label { color: var(--muted); display: flex; gap: 7px; align-items: center; cursor: pointer; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.alert { display: none; margin-top: 16px; padding: 11px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px; color: var(--error); font-size: 13px; }
.alert.show { display: block; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- status ---- */
.status-banner { display: flex; align-items: center; gap: 14px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; padding: 20px 24px; border-radius: var(--radius); font-weight: 600; font-size: 18px; margin-bottom: 28px; }
.status-banner .dot { width: 12px; height: 12px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.status-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.status-list .item { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.status-list .item:last-child { border-bottom: none; }
.status-list .ok { color: #15803d; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.status-list .ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }

/* ---- error page ---- */
.err-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; text-align: center; padding: 40px 24px; }
.err-code { font-size: clamp(80px, 16vw, 150px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err-wrap h1 { font-size: 26px; margin: 8px 0 10px; letter-spacing: -0.02em; }
.err-wrap p { color: var(--muted); max-width: 420px; margin: 0 auto 26px; }

@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
}
