/* Student page: a blue header, "Моя запись" in pink, days of free hours on white cards. The booking form and the
   move confirm open in place under the chosen day. Nothing with a field in it is fixed to the screen. */

body.student { display: grid; grid-template-columns: minmax(0, var(--layout-student)); justify-content: center; }
.page > * { margin-left: var(--space-md); margin-right: var(--space-md); }
.page > .head { margin-left: 0; margin-right: 0; }
.page::after { content: ""; display: block; height: calc(var(--space-3xl) + var(--safe-b)); }

/* ---------- header ---------- */
.head {
  padding: calc(var(--space-2xl) + var(--safe-t)) var(--space-xl) var(--space-2xl);
  background: var(--color-accent); color: var(--color-on-accent);
  border-radius: 0 0 var(--shape-xl) var(--shape-xl);
}
.head .who { margin-top: var(--space-md); }
.head .intro { margin-top: var(--space-lg); max-width: 32em; }
/* with a booking ahead: one line, "Консультация · {teacher}" */
.head-compact { padding: calc(var(--space-lg) + var(--safe-t)) var(--space-xl) var(--space-lg); border-radius: 0 0 var(--shape-lg) var(--shape-lg); }
.head-compact h1 { font: var(--type-title); font-variant-numeric: lining-nums tabular-nums; letter-spacing: normal; }
.head-compact .who, .head-compact .intro { display: none; }

/* ---------- my booking ---------- */
.mine { margin-top: var(--space-lg); }
/* an instant scroll to a block leaves air above it (and room for the notch) */
.mine, .mine > *, .hours { scroll-margin-top: calc(var(--space-md) + var(--safe-t)); }
.mine > * + * { margin-top: var(--space-sm); }
/* after booking, moving or cancelling, the result arrives: the booking first, then reminders, then move / cancel */
.mine.is-arriving > * { animation: arrive var(--t-arrive) var(--ease-out) both; }
.mine.is-arriving > :nth-child(2) { animation-delay: var(--t-stagger); }
.mine.is-arriving > :nth-child(n + 3) { animation-delay: calc(2 * var(--t-stagger)); }

/* the booking itself: pink means "a booking" everywhere on the site */
.ticket {
  --color-focus: var(--color-on-booking);
  padding: var(--card-pad) var(--card-pad) var(--space-lg);
  background: var(--hour-booked-bg); color: var(--hour-booked-fg); border-radius: var(--sheet-radius);
}
.ticket a:not(.btn), .ticket .link { color: var(--color-on-booking); }
.ticket > * + * { margin-top: var(--space-md); }
/* the day, then the hours with «МСК» after them; «МСК» goes to its own line when the hours fill the width (320) */
.when { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-sm); }
.when-day { flex-basis: 100%; }
.when .when-time { white-space: nowrap; }
/* inside the pink booking: the usual button is an outline in the booking's ink, the main one (-booking) is filled with it.
   A white button read as main in the light theme and merged with the filled one in the dark theme */
.ticket .btn:not(.btn-primary):not(.btn-danger):not(.btn-booking) { --_container: transparent; border-color: var(--color-on-booking); color: var(--color-on-booking); }
.ticket .btn { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.ticket .hint { color: var(--color-on-booking); }
/* «Запись готова» with a tick that draws itself once, right after the booking arrives */
.ticket-title { display: flex; align-items: center; gap: var(--space-sm); }
.ticket-title .ico { width: var(--icon-size-md); height: var(--icon-size-md); }
/* the way into the meeting: a button and the waiting-room line under it */
.meet > * + * { margin-top: var(--space-sm); }

/* move and cancel, under the reminders: plain buttons on the page ground */
.mine > .manage { margin-top: var(--space-lg); }
.manage > * + * { margin-top: var(--space-sm); }
.manage > p { padding: 0 var(--space-lg); }
.manage .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.manage .actions:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.manage .btn { padding-left: var(--space-lg); padding-right: var(--space-lg); }

/* white cards: no booking, reminders, the saved link */
.card { padding: var(--card-pad); background: var(--color-surface); border-radius: var(--card-radius); }
.card > * + * { margin-top: var(--space-md); }
.card .note { background: var(--color-bg); }
.card .past summary, .remind-details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  min-height: var(--tap); border-radius: var(--shape-sm); cursor: pointer;
}
.card .past li { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-sm) 0; border-top: 1px solid var(--color-divider); }

summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; width: 8px; height: 8px; flex: none; margin-right: var(--space-sm);
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform var(--t-pop) var(--ease-out);
}
details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }

/* reminders */
.remind-opt { padding: var(--space-lg) 0; border-top: 1px solid var(--color-divider); }
.remind-opt > * + * { margin-top: var(--space-sm); }
.remind > .remind-opt:last-child, .remind-details .remind-opt:last-child { padding-bottom: 0; }
.remind-opt .btn { width: 100%; padding-left: var(--space-lg); padding-right: var(--space-lg); }
/* a chosen channel: a tick (Iconoteka) before the line, on the first line's centre (24 line - 20 icon = 2 on top) */
.remind .done { display: flex; align-items: flex-start; gap: var(--space-sm); }
.remind .done .ico { width: var(--icon-size-md); height: var(--icon-size-md); margin-top: 2px; color: var(--color-accent); }
.remind-sub > * + * { margin-top: var(--space-sm); }
.remind-sub + .remind-sub { margin-top: var(--space-lg); }
.remind-opts > .remind-opt:last-child { padding-bottom: 0; }
/* after a choice: the chosen channels with a tick and "Изменить" */
.remind-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.remind-done { display: grid; gap: var(--space-xs); }

/* ---------- free hours ---------- */
.hours { margin-top: var(--space-2xl); }
.hours > h2 { padding: 0 var(--space-lg); }
.hours-line { margin-top: var(--space-md); padding: 0 var(--space-lg); }
.days { margin-top: var(--space-md); }
.days > * + * { margin-top: var(--space-sm); }
/* day block: card with a tight padding, so the tiles are concentric (24 - 8 = 16) */
.day { padding: var(--card-pad-tight); background: var(--color-surface); border-radius: var(--card-radius); }
.day-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-sm); padding: var(--space-sm) var(--space-sm) 0; }
.day-title .rel { color: var(--color-on-surface-muted); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--tile-gap); margin-top: var(--space-md); }
@media (max-width: 359px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* a free hour: white, blue figures, thin border; the chosen one is filled blue */
/* hour tile (student): free, selected. Same shape and states as the hub tile. The tile is kept between renders
   (student.js patchDays), so choosing an hour fades its fill in instead of popping */
.slot {
  --_container: var(--hour-free-bg);
  min-height: var(--tile-height); padding: 0 var(--space-xs);
  border: 1px solid var(--hour-free-border); border-radius: var(--tile-radius);
  background-color: var(--_container); color: var(--hour-free-fg);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-press) var(--ease-out), color var(--t-press) var(--ease-out), border-color var(--t-press) var(--ease-out);
}
@media (hover: hover) { .slot:hover { background-color: color-mix(in srgb, currentColor var(--state-hover), var(--_container)); } }
.slot.is-hover { background-color: color-mix(in srgb, currentColor var(--state-hover), var(--_container)); }
.slot:active, .slot.is-active { transform: scale(var(--state-press-scale)); background-color: color-mix(in srgb, currentColor var(--state-pressed), var(--_container)); }
.slot[aria-pressed="true"] { --_container: var(--hour-selected-bg); border-color: var(--hour-selected-border); color: var(--hour-selected-fg); }
.day-skel { height: 128px; }
.day-note { margin-top: var(--space-sm); }

/* move: the strip above the hours */
.move-top { display: grid; gap: var(--space-sm); padding: var(--space-lg); margin-top: var(--space-md); background: var(--color-surface); border-radius: var(--shape-lg); box-shadow: inset 0 0 0 1px var(--color-accent); }
.move-top .row { justify-content: flex-start; }

/* ---------- the block under a day: booking form and move confirm ----------
   Opens in place under the tiles of its day, in the content layer: solid, no glass, not fixed. While its field has
   focus the browser itself brings it above the keyboard; the page has no keyboard script. Controls sit 8 px in like
   the tiles (day radius 24 - 8 = 16 for the plate and the field), text 8 px further in, in line with the day title */
.daybox { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-divider); }
.daybox > * + * { margin-top: var(--space-md); }
.daybox > p:not(.note), .daybox .field > .label, .daybox .field > .error { padding: 0 var(--space-sm); }
.book-when { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-md); }
/* the chosen time: the day over the hours, like «Моя запись» in small; 16 in from every side, radius 24 - 8 = 16 */
.slot-plate { display: grid; padding: var(--space-lg); border-radius: var(--shape-md); background: var(--hour-selected-bg); color: var(--hour-selected-fg); }
.daybox .other { min-height: var(--tap); padding: 0 var(--space-sm); white-space: nowrap; }
.daybox .privacy { color: var(--color-on-surface-muted); }
.daybox .row .btn { flex: 1 1 140px; padding-left: var(--space-lg); padding-right: var(--space-lg); }

/* ---------- footer ---------- */
.foot { margin-top: var(--space-2xl); padding: 0 var(--space-lg); }
.foot-links > li + li { margin-top: 0; }
.foot .privacy-line { margin-top: var(--space-sm); color: var(--color-on-surface-muted); }
.lost summary { color: var(--color-accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; width: fit-content; border-radius: var(--shape-sm); }
.lost summary::after { display: none; }
.lost-body { margin-bottom: var(--space-sm); padding: var(--space-lg); background: var(--color-surface); border-radius: var(--shape-lg); }
.lost-body > * + * { margin-top: var(--space-sm); }

/* ---------- message to the teacher ---------- */
#msg-view { padding-top: calc(var(--space-lg) + var(--safe-t)); }
#msg-view h1 { margin-top: var(--space-sm); margin-bottom: var(--space-lg); padding: 0 var(--space-lg); }
.msg-card { padding: var(--card-pad); background: var(--color-surface); border-radius: var(--card-radius); }
.msg-as { margin-bottom: var(--space-lg); }
.msg-form .submit { margin-top: var(--space-xl); }
.msg-form .error-box { margin-top: var(--space-lg); }
.msg-done > * + * { margin-top: var(--space-md); }
.back { text-decoration: none; }
#msg-view > p:first-child { padding: 0 var(--space-lg); }

@media (min-width: 768px) {
  body.student { padding-top: var(--space-2xl); }
  .page > * { margin-left: 0; margin-right: 0; }
  .head { border-radius: var(--shape-xl); }
  .head-compact { border-radius: var(--shape-lg); }
}

@media (prefers-reduced-motion: reduce) {
  .slot:active, .slot.is-active { transform: none; }
  summary::after { transition: none; }
}

/* ---------- type roles (scale in base.css) ---------- */
.day-title { font: var(--type-title); font-variant-numeric: lining-nums tabular-nums; }
.slot { font: var(--type-numeric); font-variant-numeric: lining-nums tabular-nums; }
.day-title .rel { font: var(--type-body); font-variant-numeric: lining-nums tabular-nums; }
.when-tz, .plate-day { font: var(--type-label); font-variant-numeric: lining-nums tabular-nums; }
.plate-time { font: var(--type-numeric); font-variant-numeric: lining-nums tabular-nums; }
.daybox .privacy, .foot .privacy-line, .move-top .muted { font: var(--type-caption); font-variant-numeric: lining-nums tabular-nums; }
