:root {
  --bg: #111317;
  --surface: #181b21;
  --surface-soft: #1f232b;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f6f8;
  --muted: #a7adb8;
  --yellow: #f4c430;
  --yellow-soft: #ffde69;
  --black: #090a0d;
  --white: #ffffff;
  --success: #16c47f;
  --danger: #ff6b6b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(244, 196, 48, 0.14), transparent 28%),
    linear-gradient(180deg, #0f1115 0%, #14171d 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  display: block;
  max-width: 100%;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.stack {
  width: min(100%, 920px);
  display: grid;
  gap: 1rem;
}

.booking-card {
  width: 100%;
  padding: 1.25rem;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(24, 27, 33, 0.96), rgba(18, 20, 25, 0.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.brand__icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
}

.brand__icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--black);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
}

.intro,
.modal__text,
.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.intro {
  margin-bottom: 1rem;
}

.edit-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.edit-notice[hidden] {
  display: none;
}

.edit-notice span {
  color: var(--yellow-soft);
  font-weight: 700;
}

.price-box,
.summary-box,
.result-box,
.list-summary,
.student-item,
.empty-state,
.field input,
.field select {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.price-box,
.summary-box {
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.price-box span,
.summary-row span,
.result-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.price-box strong {
  font-size: 1.5rem;
  color: var(--yellow-soft);
}

.booking-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field--search {
  margin-bottom: 1rem;
}

.field span {
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 54px;
  padding: 0.95rem 1rem;
  color: var(--white);
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field select:focus {
  border-color: rgba(244, 196, 48, 0.45);
  box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.1);
}

.summary-box {
  display: grid;
  gap: 0.75rem;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-row strong {
  font-size: 1rem;
}

.button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  font-weight: 700;
  color: var(--black);
  background: linear-gradient(180deg, var(--yellow-soft), var(--yellow));
  transition: transform var(--transition), opacity var(--transition);
}

.button--small {
  min-height: 46px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.75;
  cursor: wait;
}

.button--secondary,
.button--ghost {
  color: var(--white);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.list-summary {
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.list-summary span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.list-summary strong {
  font-size: 1.4rem;
  color: var(--yellow-soft);
}

.student-list {
  display: grid;
  gap: 0.85rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.pagination[hidden] {
  display: none;
}

.page-indicator {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.student-item {
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transition: transform var(--transition), border-color var(--transition);
}

.student-item:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 196, 48, 0.2);
}

.student-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.student-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.student-item p,
.student-meta span,
.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ticket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(244, 196, 48, 0.14);
  color: var(--yellow-soft);
  font-weight: 700;
}

.student-meta {
  display: grid;
  gap: 0.2rem;
}

.student-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.student-actions .button {
  flex: 1 1 140px;
}

.button--danger {
  color: var(--white);
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.empty-state {
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.button__spinner {
  width: 16px;
  height: 16px;
  display: none;
  border-radius: 50%;
  border: 2px solid rgba(9, 10, 13, 0.2);
  border-top-color: var(--black);
  animation: spin 0.8s linear infinite;
}

.button.is-loading .button__spinner {
  display: inline-block;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 40;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 11, 0.72);
}

.modal__dialog {
  position: relative;
  width: min(92vw, 500px);
  padding: 1.25rem;
  border-radius: 24px;
  background: #171a20;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.result-grid,
.modal__actions {
  display: grid;
  gap: 0.75rem;
}

.result-grid {
  grid-template-columns: 1fr;
  margin: 1rem 0;
}

.result-box {
  padding: 0.95rem;
  border-radius: var(--radius-md);
}

.result-box strong {
  font-size: 1.2rem;
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.7rem;
}

.toast {
  min-width: min(92vw, 320px);
  padding: 0.95rem 1rem;
  border-radius: 16px;
  color: var(--white);
  background: #181b21;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toast--success {
  border-color: rgba(22, 196, 127, 0.35);
}

.toast--error {
  border-color: rgba(255, 107, 107, 0.35);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 640px) {
  .booking-card,
  .modal__dialog {
    padding: 1.5rem;
  }

  .result-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal__actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .stack {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 520px) {
  .pagination {
    flex-direction: column;
  }

  .pagination .button {
    width: 100%;
  }
}
