:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --success: #027a48;
  --warning: #b54708;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.13), transparent 32rem),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.10), transparent 30rem),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  padding: 20px 0;
  border-bottom: 1px solid rgba(228, 231, 236, 0.8);
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #0f172a;
  color: white;
  font-weight: 900;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-weight: 700; }

nav { display: flex; gap: 8px; flex-wrap: wrap; }

.nav-button {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.nav-button:hover, .nav-button.active { background: #eef2ff; color: #1e3a8a; }

main { padding: 34px 0; }

.panel {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(228,231,236,0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  padding: 34px;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
}

.hero-panel, .team-panel, .case-file { padding: 28px; }

.eyebrow {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 999px;
  color: #1e3a8a;
  background: #eef2ff;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 14px;
}

h1 { margin: 0; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -0.05em; }
h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
h3 { margin: 0 0 10px; font-size: 18px; }
p { color: var(--muted); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.form-grid.narrow { grid-template-columns: 1fr; margin-top: 0; }
.full { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: #344054;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  background: white;
  color: var(--text);
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(29,78,216,0.14); border-color: var(--primary); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  font-weight: 850;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: white; color: #1f2937; border: 1px solid var(--border); }

.team-list { display: grid; gap: 12px; margin-top: 18px; }
.team-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 13px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  opacity: .72;
}
.team-item.active { opacity: 1; border-color: #c7d2fe; background: #eef2ff; }
.team-icon {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 14px; background: #0f172a; color: white; font-weight: 900;
}
.team-item strong, .team-item span { display: block; }
.team-item span { color: var(--muted); font-size: 14px; }

.case-file { margin-top: 22px; }
.case-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.status-badge {
  border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 900;
  background: #fff7ed; color: var(--warning);
}
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.case-grid section, .questions-section, #resultSection {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: white;
}
.questions-section, #resultSection { margin-top: 16px; }
.question-list { display: grid; gap: 14px; margin-top: 16px; }
.question-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px;
  background: var(--panel-soft);
}
.question-card label { margin-bottom: 8px; }

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  overflow: auto;
}

.message { min-height: 24px; color: var(--danger); }
.message.success { color: var(--success); }
.global-message { margin: 16px 4px; font-weight: 750; }

footer { padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .auth-panel, .hero-grid, .case-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 26px, 1180px); }
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  h1 { font-size: 36px; }
}
