:root {
  --bg: #f4ede4;
  --bg-soft: #efe4d6;
  --card: rgba(255, 251, 245, 0.92);
  --card-strong: rgba(255, 248, 239, 0.97);
  --border: rgba(111, 29, 51, 0.16);
  --text: #44232d;
  --muted: #7d6262;
  --accent: #8f1838;
  --accent-2: #c8a35f;
  --warning: #c98e34;
  --danger: #c75c6c;
  --shadow: 0 20px 60px rgba(89, 44, 57, 0.12);
  --burgundy: #8f1838;
  --burgundy-soft: #b43157;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(200, 163, 95, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(143, 24, 56, 0.10), transparent 28%),
    linear-gradient(180deg, #f7f0e7 0%, #efe2d3 100%);
  color: var(--text);
  min-height: 100vh;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr minmax(240px, 320px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(251, 243, 233, 0.96)),
    linear-gradient(90deg, rgba(143, 24, 56, 0.04), rgba(200, 163, 95, 0.06));
}

.hero, .live-panel, .week-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  padding: 22px;
}

.hero > :not(.hero-ornament) {
  position: relative;
  z-index: 1;
}

.hero-ornament {
  position: absolute;
  inset: 0 0 auto 0;
  height: 210px;
  color: var(--accent);
  pointer-events: none;
}

.hero-ornament__label {
  position: absolute;
  top: 18px;
  right: 22px;
  border: 1px solid rgba(143, 24, 56, 0.16);
  background: rgba(143, 24, 56, 0.06);
  color: var(--burgundy);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.hero-ornament__svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: translateY(2px);
  opacity: 0.95;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 10px;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0.01em; color: var(--burgundy); }
h1 {
  font-size: clamp(26px, 4.2vw, 42px);
  line-height: 1.02;
  margin-bottom: 12px;
}
.hero-copy, .live-description {
  color: var(--muted);
  line-height: 1.5;
  max-width: 760px;
  font-size: 15px;
}

.hero::after {
  content: "ЭКОНОМИЧЕСКИЙ ФАКУЛЬТЕТ";
  position: absolute;
  left: 22px;
  bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(143, 24, 56, 0.32);
  font-weight: 700;
}

.hero-stats { display: flex; }
.stat-card {
  width: 100%;
  min-height: 100%;
  background: linear-gradient(180deg, rgba(143, 24, 56, 0.10), rgba(200, 163, 95, 0.12));
  border: 1px solid rgba(143, 24, 56, 0.12);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-label, .stat-note {
  color: var(--muted);
}
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.total-card strong {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  color: var(--burgundy);
}

.live-panel {
  padding: 20px 22px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(251, 243, 233, 0.96));
}
.live-panel__header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.live-status, .session-status-badge, .attendance-badge {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.live-status {
  background: rgba(143, 24, 56, 0.06);
  border: 1px solid rgba(143, 24, 56, 0.10);
  color: var(--muted);
}
.live-status.active {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-soft));
  box-shadow: 0 0 24px rgba(143, 24, 56, 0.18);
}

.checkin-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.checkin-form label { font-weight: 600; }
.checkin-row {
  display: flex;
  gap: 12px;
}
.checkin-row input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 700;
}
.checkin-row button {
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  min-height: 50px;
  font-size: 15px;
  font-weight: 800;
  color: #07121d;
  background: linear-gradient(135deg, #9fb4ff, #56e3c3);
  cursor: pointer;
}
.checkin-row button:hover { filter: brightness(1.05); }
.form-hint { color: var(--muted); font-size: 14px; }
.flash {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}
.flash.ok { border-color: rgba(212, 175, 106, 0.34); color: #fff0d0; }
.flash.error { border-color: rgba(255, 156, 167, 0.38); color: #ffd9de; }

.weeks {
  display: grid;
  gap: 18px;
}
.week-card {
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(252, 244, 236, 0.96));
}
.week-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.week-title { font-size: 22px; }
.week-meta { color: var(--muted); }
.session-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.session-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(248, 238, 226, 0.92));
  border: 1px solid rgba(143, 24, 56, 0.10);
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-card.active {
  border-color: rgba(212, 175, 106, 0.5);
  box-shadow: 0 0 0 1px rgba(212, 175, 106, 0.16), 0 0 28px rgba(212, 175, 106, 0.14);
}
.session-card.closed {
  background: linear-gradient(180deg, rgba(248, 238, 226, 0.98), rgba(239, 224, 211, 0.98));
}
.session-card.future {
  opacity: 0.92;
}
.session-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.session-day {
  font-size: 16px;
  font-weight: 700;
}
.session-date, .session-note { color: var(--muted); font-size: 14px; }
.session-time {
  font-size: 22px;
  font-weight: 800;
}
.session-status-badge.future {
  background: rgba(143, 24, 56, 0.06);
  color: var(--muted);
}
.session-status-badge.active {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-soft));
  box-shadow: 0 0 24px rgba(143, 24, 56, 0.16);
}
.session-status-badge.closed {
  background: rgba(212, 175, 106, 0.12);
  color: #f0d8a7;
}
.attendance-badge {
  background: rgba(143, 24, 56, 0.08);
  color: var(--burgundy);
  border: 1px solid rgba(143, 24, 56, 0.12);
}
.attendance-badge.live {
  background: rgba(200, 163, 95, 0.14);
  color: var(--burgundy);
  border-color: rgba(200, 163, 95, 0.32);
}
.hidden { display: none !important; }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-ornament {
    height: 140px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 16px, 1180px);
    padding-top: 12px;
    padding-bottom: 40px;
  }
  .hero, .live-panel, .week-card { border-radius: 20px; }
  .hero, .live-panel, .week-card { padding-left: 16px; padding-right: 16px; }
  .hero-ornament {
    height: 108px;
  }
  .hero-ornament__label {
    top: 14px;
    right: 16px;
    padding: 5px 8px;
    font-size: 10px;
  }
  .hero::after {
    left: 16px;
    bottom: 14px;
    font-size: 10px;
    letter-spacing: 0.16em;
  }
  .eyebrow { font-size: 11px; margin-bottom: 8px; }
  h1 { font-size: 24px; margin-bottom: 10px; }
  .hero-copy, .live-description { font-size: 14px; line-height: 1.45; }
  .live-panel__header, .week-header, .session-topline, .checkin-row {
    flex-direction: column;
  }
  .week-title { font-size: 20px; }
  .session-day { font-size: 15px; }
  .session-time { font-size: 20px; }
  .checkin-row input { font-size: 17px; }
  .checkin-row button { width: 100%; }
  .session-list { grid-template-columns: 1fr; }
}
