:root {
  --bg: #eef5fb;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-border: #d5e0ea;
  --text: #17324d;
  --muted: #667b91;
  --primary: #0f5ea8;
  --primary-dark: #123f73;
  --accent: #2fbf9f;
  --danger: #b63d3d;
  --success: #1c8c63;
  --shadow: 0 24px 60px rgba(16, 36, 64, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 121, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(47, 191, 159, 0.16), transparent 20%),
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
}

.auth-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.auth-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.topbar-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #cbd8e3;
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 520px);
  gap: 22px;
}

.auth-hero,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-hero {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 94, 168, 0.12), transparent 70%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4a79ff);
  box-shadow: 0 0 0 6px rgba(74, 121, 255, 0.08);
}

.auth-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.auth-hero p {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.feature-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.feature-list li {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: rgba(242, 247, 252, 0.92);
  border: 1px solid #d9e4ee;
  color: #21415f;
  line-height: 1.45;
}

.auth-card {
  padding: 28px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.auth-card .card-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 16px;
}

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

.field label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60758d;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #cdd9e5;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(15, 94, 168, 0.6);
  box-shadow: 0 0 0 4px rgba(15, 94, 168, 0.12);
  transform: translateY(-1px);
}

.field-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 16px 30px rgba(18, 63, 115, 0.22);
}

.secondary-button {
  border-color: #cfdae5;
  background: #fff;
  color: var(--primary-dark);
}

.form-actions,
.auth-inline-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.status-banner {
  display: none;
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  font-weight: 700;
  line-height: 1.45;
}

.status-banner.visible {
  display: block;
}

.status-banner.error {
  background: rgba(182, 61, 61, 0.1);
  border: 1px solid rgba(182, 61, 61, 0.18);
  color: var(--danger);
}

.status-banner.success {
  background: rgba(28, 140, 99, 0.1);
  border: 1px solid rgba(28, 140, 99, 0.18);
  color: var(--success);
}

.session-chip {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(229, 241, 252, 0.92);
  border: 1px solid #c9dcef;
  color: #18486d;
  font-weight: 700;
}

.session-chip.visible {
  display: block;
}

.history-layout {
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
}

.history-card {
  min-width: 0;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-empty {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed #cfdbe6;
  background: rgba(247, 250, 253, 0.92);
  color: var(--muted);
  line-height: 1.5;
}

.history-item {
  border: 1px solid #d8e3ed;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,250,253,0.98));
  padding: 18px;
  display: grid;
  gap: 14px;
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.history-item h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.history-time {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.history-summary {
  color: #34506a;
  line-height: 1.55;
  margin: 0;
}

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

.history-stat {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid #dce7f0;
  background: rgba(241, 247, 252, 0.88);
}

.history-stat-label {
  color: #667b91;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.history-stat-value {
  color: #17324d;
  line-height: 1.45;
  font-weight: 600;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #d6e2ec;
  background: rgba(255,255,255,0.96);
  color: #244360;
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 860px) {
  .auth-shell {
    width: min(100% - 24px, 720px);
    padding-top: 20px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .history-grid {
    grid-template-columns: 1fr;
  }

  .auth-hero,
  .auth-card {
    padding: 24px;
  }

  .auth-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
