/* Анкетирование ООП ВО — фирменный стиль АГПУ
   Бирюзовый градиент бренда + золото юбилейной эмблемы; светлое оформление для сайта университета. */

:root {
  --teal-900: #173A3E;
  --teal-800: #1F5A61;
  --teal-700: #2C8488;
  --teal-600: #3E9CA4;
  --teal-400: #4BC5D0;
  --teal-200: #BFE2E5;
  --teal-100: #DDF0F2;
  --teal-50:  #F1F8F9;
  --gold-200: #F5E7BE;
  --gold-300: #E9CD76;
  --gold-500: #D2A651;
  --gold-700: #9A6A2E;
  --gold-800: #6E4A1C;

  --bg: #F3F8F8;
  --surface: #FFFFFF;
  --ink: var(--teal-900);
  --muted: #5A7679;
  --line: #D6E7E9;
  --danger: #B4472F;
  --danger-soft: #F8E4DE;
  --ok-soft: #E1F2EA;

  --brand-gradient: linear-gradient(118deg, #3F8D97 0%, #3E9CA4 42%, #44B2BC 72%, #4BC5D0 100%);

  --font-display: "Unbounded", "Golos Text", "Segoe UI", Arial, sans-serif;
  --font-body: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(23, 58, 62, .06), 0 6px 20px rgba(23, 58, 62, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; }
p { margin: 0; }
a { color: var(--teal-700); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
code { background: var(--teal-100); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page { padding-block: 36px 64px; display: flex; flex-direction: column; gap: 22px; }
.page--narrow { max-width: 860px; }
.muted { color: var(--muted); }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .88);
}
.eyebrow--dark { color: var(--gold-700); }

/* ---------- Шапка ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-gradient);
  color: #FFFFFF;
}
.hero__building {
  position: absolute;
  left: -40px;
  bottom: -30px;
  width: min(62vw, 720px);
  opacity: .32;
  pointer-events: none;
  user-select: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 32px;
  padding-block: 34px 38px;
}
.hero__text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -.01em;
}
.hero__lead { color: rgba(255, 255, 255, .92); max-width: 56ch; font-size: 17px; }
.hero__back {
  align-self: flex-start;
  color: #FFFFFF; text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16);
}
.hero__back:hover { background: rgba(255, 255, 255, .26); }
.hero__logo { justify-self: end; display: block; }
.hero__logo img { display: block; width: min(300px, 100%); height: auto; filter: drop-shadow(0 2px 10px rgba(23, 58, 62, .25)); }
.hero--big .hero__inner { padding-block: 56px 64px; }
.hero--big h1 { font-size: clamp(26px, 4vw, 40px); }
.hero--big .hero__logo img { width: min(440px, 100%); }
.hero--big .hero__building { width: min(70vw, 820px); opacity: .38; }

@media (max-width: 760px) {
  .hero__inner { grid-template-columns: 1fr; gap: 20px; padding-block: 24px 28px; }
  .hero__logo { justify-self: start; order: -1; }
  .hero__logo img, .hero--big .hero__logo img { width: min(240px, 70vw); }
  .hero--big .hero__inner { padding-block: 28px 36px; }
  .hero__building, .hero--big .hero__building { width: 130vw; left: -20vw; opacity: .22; }
}

/* ---------- Заголовки разделов ---------- */
.section-heading {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(18px, 2.4vw, 22px); color: var(--teal-800);
}
.section-heading::before {
  content: ""; flex: none; width: 26px; height: 8px; border-radius: 0 6px 6px 0;
  background: linear-gradient(90deg, var(--gold-300), var(--gold-500));
}
.section-heading--sm { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; padding-top: 14px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 16px; line-height: 1.2;
  padding: 13px 24px; border-radius: 14px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; transition: filter .15s, background-color .15s, border-color .15s;
}
.btn--primary {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  border-color: #C79A47;
  color: #3A2A10;
}
.btn--primary:hover { filter: brightness(1.05) saturate(1.05); }
.btn--ghost { background: var(--surface); border-color: var(--teal-200); color: var(--teal-800); }
.btn--ghost:hover { border-color: var(--teal-700); }
.btn--link { background: none; color: var(--teal-700); padding-inline: 8px; }
.btn--danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--wide { width: 100%; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

/* ---------- Карточки анкет на главной ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--teal-800); }
.card p { color: var(--muted); flex: 1; }
.card .btn { align-self: flex-start; margin-top: 6px; }
.card__count {
  align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--teal-700);
  background: var(--teal-100); padding: 3px 10px; border-radius: 999px;
}
.card__state { font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 0 2px; }
.card__state--done { color: var(--teal-700); }

.about { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr; } }
.facts li { color: var(--muted); }
.facts b { color: var(--ink); display: block; }

/* ---------- Форма анкеты ---------- */
.intro { font-size: 17px; color: var(--muted); max-width: 68ch; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; width: 100%;
}
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-600); outline: none; box-shadow: 0 0 0 3px var(--teal-100); }
.survey .field input, .survey .field select { max-width: 560px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.questions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.question {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 12px;
  transition: border-color .15s;
}
.question:has(input:checked) { border-color: var(--teal-200); }
.question--missing { border-color: var(--danger); background: #FFFBFA; }
.question__num { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--gold-700); padding-top: 2px; }
.question__body {
  border: 0; margin: 0; padding: 0; min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: center;
}
.question__text { padding: 0; float: left; width: 100%; }
@media (max-width: 640px) { .question__body { grid-template-columns: 1fr; } }

/* Кнопки «Да» и «Нет» — одинаковые по виду */
.yn { display: flex; gap: 8px; }
.yn__opt { position: relative; cursor: pointer; }
.yn__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.yn__opt span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 84px; padding: 10px 18px; border-radius: 12px;
  border: 1.5px solid var(--teal-200); background: var(--surface);
  color: var(--teal-800); font-weight: 600; user-select: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.yn__opt:hover span { border-color: var(--teal-700); }
.yn__opt input:checked + span { background: var(--teal-700); border-color: var(--teal-700); color: #FFFFFF; }
.yn__opt input:focus-visible + span { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.submitbar {
  position: sticky; bottom: 0; z-index: 5;
  margin-top: 8px; padding-block: 14px max(14px, env(safe-area-inset-bottom, 0px));
  background: rgba(243, 248, 248, .96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.submitbar__progress { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; max-width: 360px; }
.submitbar__label { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { display: block; height: 8px; border-radius: 999px; background: var(--teal-100); overflow: hidden; }
.progress__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--teal-700); transition: width .25s; }

/* ---------- Сообщения и состояния ---------- */
.notice { border-radius: 12px; padding: 12px 16px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.notice--error { background: var(--danger-soft); color: #6B2716; }
.notice--ok { background: var(--ok-soft); color: #1D5236; }
.state-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; box-shadow: var(--shadow);
}
.state-box h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--teal-800); }
.state-box p { color: var(--muted); max-width: 60ch; }
.state-box--success h2::before { content: "✓"; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 12px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-300), var(--gold-500)); color: #3A2A10; font-size: 18px; vertical-align: middle; }

/* ---------- Подвал ---------- */
.footer { background: var(--teal-700); color: rgba(255, 255, 255, .85); margin-top: 24px; }
.footer__inner { padding-block: 22px max(22px, env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.footer b { color: var(--gold-300); font-family: var(--font-display); font-weight: 600; letter-spacing: .03em; }

/* ---------- Вход ---------- */
.login-page { background: var(--brand-gradient); }
.login { position: relative; overflow: hidden; display: grid; place-items: center; padding: 40px 16px; min-height: 100vh; }
.login__building { position: absolute; left: -60px; bottom: -40px; width: min(80vw, 900px); opacity: .28; pointer-events: none; }
.login__card {
  position: relative; width: min(420px, 100%); background: var(--surface); border-radius: var(--radius-lg);
  padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(23, 58, 62, .25);
}
.login__logo { width: 210px; align-self: center; margin-bottom: 4px; }
.login__card h1 { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--teal-800); text-align: center; }
.login__card > .muted { text-align: center; margin-top: -6px; }
.login__form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }

/* ---------- Админ-панель ---------- */
.adminbar { background: var(--brand-gradient); color: #FFFFFF; }
.adminbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 12px; }
.adminbar__brand { display: flex; align-items: center; gap: 12px; color: #FFFFFF; text-decoration: none; }
.adminbar__brand img { height: 36px; width: auto; }
.adminbar__brand span { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; flex-direction: column; line-height: 1.2; }
.adminbar__brand small { font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--gold-200); letter-spacing: .06em; }
.adminbar__nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.adminbar__nav a, .adminbar__logout button {
  color: #FFFFFF; text-decoration: none; font: inherit; font-weight: 500; font-size: 15px;
  padding: 8px 14px; border-radius: 10px; background: none; border: 0; cursor: pointer;
}
.adminbar__nav a:hover, .adminbar__logout button:hover { background: rgba(255, 255, 255, .16); }
.adminbar__nav a[aria-current="page"] { background: #FFFFFF; color: var(--teal-800); font-weight: 600; }
.adminbar__logout { margin: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 3vw, 28px); color: var(--teal-800); margin-top: 4px; }

.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 9px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--teal-800); font-weight: 600;
}
.segmented a:hover { border-color: var(--teal-600); }
.segmented a[aria-current="page"] { background: var(--teal-700); border-color: var(--teal-700); color: #FFFFFF; }
.segmented__count { font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--teal-100); color: var(--teal-800); font-variant-numeric: tabular-nums; }
.segmented a[aria-current="page"] .segmented__count { background: var(--gold-300); color: #3A2A10; }

.filters {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.filters__actions { display: flex; gap: 6px; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters .field:first-of-type { grid-column: 1 / -1; } .filters__actions { grid-column: 1 / -1; } }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.kpi__value { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.15; color: var(--teal-800); font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi__label { font-size: 14px; color: var(--muted); }
.kpi--accent { background: var(--brand-gradient); border-color: transparent; }
.kpi--accent .kpi__value { color: var(--gold-200); }
.kpi--accent .kpi__label { color: rgba(255, 255, 255, .9); }

.note { color: var(--muted); font-size: 15px; background: var(--teal-50); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.empty { background: var(--surface); border: 1.5px dashed var(--teal-200); border-radius: var(--radius); padding: 24px; color: var(--muted); }

.stat-list { display: flex; flex-direction: column; gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 12px;
}
.stat--flag { border-left: 4px solid var(--gold-500); }
.stat__num { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--gold-700); padding-top: 2px; }
.stat__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bar { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--teal-100); }
.bar__yes { background: var(--teal-700); }
.bar__no { background: var(--gold-500); }
.stat__legend, .legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat__legend b { color: var(--ink); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw--yes { background: var(--teal-700); }
.sw--no { background: var(--gold-500); }
.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.tag--warn { background: var(--gold-200); color: var(--gold-800); }
.tag--warn::before { content: "! "; font-weight: 700; }
.tag--ok { background: var(--teal-100); color: var(--teal-800); }
.tag--ok::before { content: "✓ "; }

.chart-box { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; }
.chart-sub { font-size: 15px; font-weight: 600; color: var(--teal-800); padding-top: 8px; }
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 8px; overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 560px; height: auto; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__tick { fill: var(--muted); font: 12px var(--font-body); font-variant-numeric: tabular-nums; }
.chart__axis { fill: var(--muted); font: 12px var(--font-body); }
.chart__yes { fill: var(--teal-700); }
.chart__no { fill: var(--gold-500); }
.chart__day { fill: var(--teal-600); }
.chart__empty { fill: var(--teal-50); stroke: var(--line); }
.chart__hit { fill: transparent; }
.chart__col { cursor: default; outline: none; }
.chart__col:hover .chart__hit, .chart__col:focus .chart__hit { fill: var(--teal-700); fill-opacity: .07; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--teal-800); }
.panel--danger { border-color: #E9C3B8; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background-color .15s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--teal-700); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--gold-500); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .adminbar, .filters, .segmented, .page-head .btn, .submitbar { display: none !important; }
  body { background: #FFFFFF; }
}

@media (max-width: 640px) {
  .page { padding-block: 24px 40px; }
  .question { grid-template-columns: 2em minmax(0, 1fr); padding: 14px; gap: 8px; }
  .yn__opt span { min-width: 96px; }
  .submitbar { flex-wrap: nowrap; gap: 12px; }
  .submitbar__progress { flex: 1 1 0; max-width: none; }
  .submitbar__label { font-size: 13px; }
  .submitbar .btn { padding: 11px 16px; font-size: 15px; }
}
