@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg: #070b12;
  --bg-elevated: #0d1320;
  --surface: #131c2e;
  --surface-hover: #182438;
  --border: #243049;
  --text: #eef2f8;
  --muted: #8b9cb8;
  --accent: #22d3a8;
  --accent-dim: #14a885;
  --accent-glow: rgba(34, 211, 168, 0.25);
  --gold: #f5b942;
  --danger: #f87171;
  --success: #34d399;
  --warn: #fbbf24;
  --orange: #fb923c;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 211, 168, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(245, 185, 66, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #5eecc4;
}

.container,
.auth-wrap {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--text);
}

.logo:hover {
  text-decoration: none;
  color: var(--text);
}

.logo-x {
  color: var(--accent);
  font-size: 1.65rem;
  text-shadow: 0 0 24px var(--accent-glow);
}

.logo-rest {
  color: var(--text);
}

.logo-tagline {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 12px 20px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-user {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-user strong {
  color: var(--text);
}

.nav a.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border-color: rgba(34, 211, 168, 0.2);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 28px;
}

.auth-brand {
  text-align: center;
}

.auth-brand .logo {
  justify-content: center;
  font-size: 2rem;
}

.auth-brand .logo-x {
  font-size: 2.2rem;
}

.auth-brand p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 320px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 600;
}

.page-lead {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.95rem;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

button,
.btn {
  display: inline-block;
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #042f24;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px var(--accent-glow);
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--border);
  box-shadow: none;
}

.error {
  color: var(--danger);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.success-msg {
  color: var(--success);
  font-size: 0.9rem;
}

.check-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.check-form input {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.score-card {
  text-align: center;
  padding: 24px 16px 28px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.score-card h3 {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-value {
  font-size: 2.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color 0.2s;
}

.score-value.score-empty {
  color: var(--muted);
  font-size: 2rem;
}

.score-value.score-low {
  color: var(--success);
}

.score-value.score-mid {
  color: var(--warn);
}

.score-value.score-high {
  color: var(--orange);
}

.score-value.score-critical {
  color: var(--danger);
  text-shadow: 0 0 20px rgba(248, 113, 113, 0.35);
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.api-key-box {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  word-break: break-all;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 12px 0 16px;
  font-size: 0.9rem;
  color: var(--accent);
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.88rem;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
}

.history-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer span {
  color: var(--accent);
  font-weight: 600;
}

/* Landing */
.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.landing-header {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 0 32px;
}

.landing-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 20px;
  line-height: 1.1;
}

.landing-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 0 36px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}

.landing-actions .btn {
  min-width: 160px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 720px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-card strong {
  color: var(--text);
  font-size: 0.95rem;
}

.feature-card span {
  color: var(--muted);
  font-size: 0.85rem;
}
