/* Форма брони «Нова подія» / «Змінити подію». Утверждена 02.12.2026
   (docs/design/event-*). Плашка предпросмотра — та же, что на шкале (day.css). */

.evform { max-width: 760px; margin: 0 auto; }

.f-top {
  position: sticky;
  top: 60px; /* под шапкой приложения */
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 -24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.f-back { color: var(--date); text-decoration: none; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.f-back:hover { text-decoration: underline; }
.f-title { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 28px; }

.f-form { display: flex; flex-direction: column; gap: 20px; padding: 20px 0 0; }

.f-section { display: flex; flex-direction: column; gap: 12px; }
.f-h { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 24px; }

/* два поля в строку: специальность + курс, навычка + группа */
.f-pair { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.f-pair-wide { grid-template-columns: 3fr 1fr; }

.f-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }

.f-field { display: flex; flex-direction: column; gap: 4px; }
.f-label { font-size: 14px; line-height: 20px; font-weight: 500; }
.f-hint { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }

.f-input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;            /* 16 px: iPhone не увеличивает страницу при вводе */
}
.f-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.f-input:disabled { background: var(--raised); color: var(--muted); }

/* переключатели */
.f-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.f-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.f-choice:hover:not(:disabled) { background: var(--raised); }
.f-choice[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.f-choice:disabled { opacity: 0.5; cursor: not-allowed; }
.f-choice-main { font-weight: 600; }
.f-choice-sub { font-size: 12px; line-height: 16px; color: var(--muted); }
.f-choice[aria-checked="true"] .f-choice-sub { color: #c9d2e3; }

.f-kind-row { display: grid; grid-template-columns: 1fr 1fr; }
.f-kind-row .f-choice { min-height: 52px; padding: 12px 16px; align-items: center; }
.f-kind-row .f-choice-main { font-size: 18px; line-height: 24px; }


.f-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* кабинеты */
.f-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.f-room {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 48px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.f-room:hover { background: var(--raised); }
.f-room-number { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 24px; }
.f-room-state { font-size: 12px; line-height: 16px; color: var(--date); white-space: nowrap; }
.f-room.is-busy { background: #fdeeee; border-color: #efb8b8; }
.f-room.is-busy:hover { background: #fbe1e1; }
.f-room.is-busy .f-room-number { color: #a31f1f; }
.f-room.is-busy .f-room-state { color: #a31f1f; }
.f-room[aria-checked="true"] { border: 2px solid var(--accent); padding: 3px 9px; background: var(--ev-now-bg); }
.f-room.is-busy[aria-checked="true"] { border-color: #d32f2f; background: #fbe1e1; }

.f-warn {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #efb8b8;
  border-radius: var(--r-control);
  background: #fdeeee;
  color: #8f1d1d;
}

.f-more summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 16px; font-weight: 500; font-family: inherit; }
.f-more summary::-webkit-details-marker { display: none; }
.f-more summary::before { content: "+"; margin-right: 8px; }
.f-more[open] summary::before { content: "−"; }
.f-more[open] { gap: 12px; }

/* предпросмотр: та же плашка, что на шкале */
.f-preview { padding: 16px; border: 1px dashed var(--line); border-radius: var(--r-card); background: var(--surface); }
.f-preview .f-h { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); font-family: inherit; }
.f-preview-ev.ev { position: static; height: auto; min-height: 48px; padding: 8px 12px; white-space: normal; }

.f-message { padding: 12px 16px; border-radius: var(--r-control); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.f-message p { margin: 0; }
.f-message-warn { background: #fdeeee; color: #8f1d1d; border: 1px solid #efb8b8; }
.f-message-error { background: #fdecec; color: #8f1d1d; border: 1px solid #e8a3a3; }

.f-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 0 -24px;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.f-missing { margin-right: auto; color: var(--muted); font-size: 14px; line-height: 20px; }
.f-save { min-width: 160px; justify-content: center; }

.f-done { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.f-done-title { font-weight: 600; color: var(--ink); }
.f-done-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 767px) {
  .f-top { top: 0; margin: 0 -16px; padding: 4px 16px; }
  .f-row { grid-template-columns: 1fr 1fr; }
  .f-row > :first-child { grid-column: 1 / -1; }
  .f-rooms { grid-template-columns: repeat(3, 1fr); }
  .f-pair-wide { grid-template-columns: 1fr; }
  .f-actions { margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .f-save { min-width: 0; flex: none; }
}

.f-preview-ev.ev:hover { filter: none; box-shadow: none; }
.f-loading { padding: 48px 0; color: var(--muted); text-align: center; }

/* пока заполняют форму — нижние вкладки не нужны и закрывали бы «Зберегти» */
@media (max-width: 767px) {
  body[data-screen="event"] .tabbar { display: none; }
  body[data-screen="event"] .screen { padding-bottom: 0; }
}

.chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-nav);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.chip:hover { background: var(--raised); }
.chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
