/* ==========================================================================
   Cog Invasion Online — ToonHQ-inspired design system, gray theme
   Structure follows the ToonHQ design language (rounded cards, chunky display
   type, uppercase condensed labels, paint-bucket nav) with gray as the brand hue.
   ========================================================================== */

:root {
  --bg-top: #eceef1;
  --bg-bottom: #d6dade;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --text: #212529;
  --text-muted: #6c757d;
  --brand: #6b7280;        /* gray-500: primary buttons, accents */
  --brand-dark: #4b5563;   /* gray-600: hovers, strong accents */
  --brand-darker: #374151; /* gray-700: footer, headings on cards */
  --border: #d7dbe0;
  --danger: #c12828;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
  --font-display: "Luckiest Guy", "Comic Sans MS", cursive;
  --font-label: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg-top);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%23ffffff' fill-opacity='0.45'%3E%3Ccircle cx='22' cy='22' r='11'/%3E%3Ccircle cx='112' cy='112' r='15'/%3E%3Ccircle cx='96' cy='30' r='6'/%3E%3Ccircle cx='34' cy='104' r='7'/%3E%3Ccircle cx='70' cy='68' r='3'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 55%, var(--bg-top) 100%);
  background-attachment: fixed;
}

a { color: var(--brand-dark); }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  background: #fbfbfb;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--brand-darker);
}

.brand-icon {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-nav .greeting {
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  line-height: 1;
  padding: 11px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border-color: var(--border);
}

.btn-white {
  background: #fff;
  color: var(--brand-dark);
  border-color: #fff;
}

.btn-white:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-ghost:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-lg { padding: 15px 30px; font-size: 0.95rem; }

.btn-block { display: block; width: 100%; }

/* ---------------------------------------------------------------- layout */

.main { flex: 1; padding-top: 36px; padding-bottom: 48px; }

.site-footer {
  background: var(--brand-darker);
  color: #cfd4da;
  padding: 18px 0;
  font-size: 0.8rem;
}

.site-footer p { margin: 0; }

/* ---------------------------------------------------------------- hero */

.hero {
  text-align: center;
  padding: 26px 0 10px;
}

.hero-logo {
  width: min(560px, 100%);
  margin: 0 auto 18px;
  padding: 20px 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--brand-darker);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 26px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 34px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--brand-darker);
  margin: 0 0 8px;
}

.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.badge {
  display: inline-block;
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

/* ---------------------------------------------------------------- dashboard */

.dashboard-card { max-width: 640px; margin: 0 auto; text-align: left; }

.dashboard-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--brand-darker);
  margin: 0 0 4px;
}

.dashboard-card .muted { margin: 0 0 14px; }

.download-row { margin: 18px 0 8px; }

.progress-list { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

.stat-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value { color: var(--brand-dark); }

.progress {
  height: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}

/* ---------------------------------------------------------------- auth forms */

.auth-card { max-width: 420px; margin: 0 auto; }

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--brand-darker);
  margin: 0 0 4px;
}

.auth-card .muted { margin-top: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.field input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  outline: none;
  text-transform: none;
  letter-spacing: normal;
}

.field input:focus {
  border-color: var(--brand);
  background: var(--surface);
}

.field .optional {
  font-style: normal;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.75;
}

.switch { font-size: 0.85rem; text-align: center; }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 0.9rem;
}

.alert-error {
  background: #fbe9e9;
  border: 1px solid #f1b6b6;
  color: var(--danger);
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .brand-name { display: none; }
  .hero-title { font-size: 2rem; }
  .header-nav .greeting { display: none; }
}
