:root {
  color-scheme: light;
  --bg: #f4f7ff;
  --bg-elevated: rgba(255, 255, 255, 0.9);
  --surface: #ffffff;
  --surface-strong: #f8faff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --primary: #4461ff;
  --primary-strong: #2641d7;
  --accent: #7c3aed;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  --radius-sm: 16px;
  font-family: Inter, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-elevated: rgba(8, 15, 29, 0.9);
  --surface: #0f172a;
  --surface-strong: #111c31;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --primary: #7c93ff;
  --primary-strong: #8ba2ff;
  --accent: #a78bfa;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(68, 97, 255, 0.16), transparent 28%),
              radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.12), transparent 30%),
              var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 12px 24px rgba(68, 97, 255, 0.2);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.nav-link,
.nav-button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-link {
  color: var(--text-muted);
}

.nav-link:hover,
.nav-button:hover,
.btn:hover {
  transform: translateY(-1px);
}

.nav-button,
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 16px 34px rgba(68, 97, 255, 0.22);
}

.btn-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.16);
}

.content {
  flex: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.site-footer {
  text-align: center;
  padding: 20px 24px 28px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card,
.panel,
.hero-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.hero-panel {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 4vw, 36px);
}

.hero-title {
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.03em;
}

.hero-description,
.section-copy,
.card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.hero-actions,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.grid-columns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 20px;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(68, 97, 255, 0.1);
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
}

.list-card {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.list-card li {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.list-card li:hover {
  transform: translateY(-1px);
  border-color: rgba(68, 97, 255, 0.18);
}

.list-card a {
  font-size: 1rem;
  font-weight: 700;
}

.list-meta,
.meta {
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--surface-strong);
  color: var(--text);
}

textarea {
  min-height: 140px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(68, 97, 255, 0.14);
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: var(--warning);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
}

.search-box input {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: auto;
  width: 100%;
}

.search-box input:focus {
  box-shadow: none;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: 22px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

@media (max-width: 960px) {
  .grid-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .content {
    width: calc(100% - 24px);
    margin: 18px auto 24px;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 16px;
  }

  .card,
  .panel,
  .hero-panel {
    padding: 18px;
  }

  .btn-row,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-link,
  .nav-button,
  .btn {
    width: 100%;
  }
}
