:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-strong: #f3f4f6;
  --text: #1f2937;
  --subtext: #4b5563;
  --header: linear-gradient(135deg, #2d62ff, #5d87ff);
  --header-text: white;
  --button: #2d62ff;
  --button-hover: #254ee0;
  --border: #d2d6dc;
  --shadow: 0 16px 45px rgba(36, 56, 100, 0.08);
  --alert-bg: #eef3ff;
  --alert-border: #2d62ff;
}

[data-theme='dark'] {
  --bg: #111827;
  --surface: #1f2937;
  --surface-strong: #111827;
  --text: #e5e7eb;
  --subtext: #9ca3af;
  --header: linear-gradient(135deg, #0f172a, #1e293b);
  --header-text: #f8fafc;
  --button: #4f46e5;
  --button-hover: #4338ca;
  --border: #374151;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.32);
  --alert-bg: #1e293b;
  --alert-border: #4f46e5;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  background: var(--header);
  color: var(--header-text);
  padding: 20px 24px;
}

header .brand {
  font-size: 1.6rem;
  font-weight: 700;
}

header nav {
  margin-top: 10px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

header nav a,
header nav .theme-toggle {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 500;
}

header nav .theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

header nav .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
  text-decoration: none;
  font-weight: 500;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

button,
input[type="submit"] {
  border: none;
  border-radius: 12px;
  background: var(--button);
  color: white;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
}

button:hover,
input[type="submit"]:hover {
  background: #254ee0;
}

.link-button {
  display: inline-block;
  margin-top: 12px;
  text-decoration: none;
}

.usage-bar {
  width: 100%;
  height: 18px;
  background: rgba(45, 98, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.usage-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #2d62ff, #5d87ff);
  border-radius: 999px 0 0 999px;
  width: 0%;
  transition: width 0.3s ease;
}

.usage-summary {
  margin-top: 10px;
  color: var(--subtext);
}

.inline-code {
  display: inline-block;
  padding: 8px 12px;
  background: var(--surface-strong);
  border-radius: 12px;
  font-family: monospace;
  color: var(--text);
}

.hint {
  color: var(--subtext);
  font-size: 0.95rem;
  margin-top: -10px;
  margin-bottom: 16px;
}

.premium-card {
  border: 1px solid rgba(45, 98, 255, 0.16);
}

form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  box-sizing: border-box;
  font-size: 1rem;
  background: var(--surface-strong);
  color: var(--text);
}

textarea {
  min-height: 140px;
  resize: vertical;
  background: var(--surface-strong);
  color: var(--text);
}

.alert {
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 14px;
  border-left: 4px solid var(--alert-border);
  background: var(--alert-bg);
}
  margin-bottom: 20px;
  border-radius: 14px;
  border-left: 4px solid #2d62ff;
  background: #eef3ff;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th,
tbody td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

thead th {
  color: var(--subtext);
  font-weight: 700;
}

tbody td {
  color: var(--text);
}

tbody tr:hover {
  background: #f8fafc;
}

footer {
  text-align: center;
  color: var(--subtext);
  padding: 24px 0;
}

@media (max-width: 720px) {
  header {
    text-align: center;
  }

  header nav {
    justify-content: center;
  }
}
