/* Booking, reschedule and success screens. */

.book-root,
.succ-root {
  min-height: 100vh;
  background: var(--bg);
}

.book-root {
  padding-bottom: var(--space-8);
}

.book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--page-x);
}

.book-header h2 {
  margin: 0;
  font-size: var(--text-md);
  font-weight: 600;
}

.book-progress,
.book-body,
.resch-current,
.app-form-shell {
  width: 100%;
  max-width: var(--form);
  margin: 0 auto;
}

.book-progress {
  display: flex;
  align-items: center;
  gap: var(--icon-gap);
  padding: var(--space-5) var(--page-x) var(--space-3);
}

.book-progress-dot,
.book-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--control-sm);
  height: var(--control-sm);
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 700;
}

.book-progress-dot {
  background: var(--surface);
  color: var(--brown-light);
  box-shadow: var(--shadow-sm);
}

.book-progress-dot.active,
.book-step-head.current .book-step-num,
.book-step-label .book-step-num {
  background: var(--brown);
  color: var(--white);
}

.book-progress-dot.current {
  transform: scale(1.12);
}

.book-progress-line {
  flex: 1;
  height: var(--line-medium);
  border-radius: var(--line-medium);
  background: var(--brown);
}

.book-body {
  padding: 0 var(--page-x);
}

#booking-form,
.book-step,
.book-client-grid,
.book-svc-list,
.book-confirm {
  display: flex;
  flex-direction: column;
}

#booking-form {
  gap: var(--stack-gap);
}

.book-step {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.book-step-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--card-pad) var(--space-3);
  color: var(--brown);
  font-weight: 700;
}

.book-step-label small {
  display: block;
  margin-top: 2px;
  color: var(--brown-muted);
  font-weight: 700;
}

.book-svc-list {
  gap: var(--space-2);
  padding: 0 var(--card-pad) var(--card-pad);
}

.book-svc-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: left;
  transition: background .2s var(--ease-out), border-color .2s var(--ease-out), transform .2s var(--ease-out);
}

.book-svc-row:hover,
.date-btn:hover,
.time-slot:hover,
.waiting-time-slot:hover {
  background: var(--peach-deep);
}

.book-svc-row-img {
  width: var(--control-lg);
  height: var(--control-lg);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--peach-deep);
}

.book-svc-row-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-svc-row-body {
  flex: 1;
  min-width: 0;
}

.book-svc-row-body .font-semibold {
  display: block;
  font-weight: 600;
}

.book-svc-row-body p,
.book-svc-row-right span,
.book-confirm-row span,
.book-waiting-hint {
  color: var(--brown-light);
}

.book-svc-row-body p {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-svc-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.book-svc-row-right b {
  font-size: var(--text-base);
  font-weight: 700;
}

.book-svc-row-right span {
  font-size: var(--text-2xs);
}

.book-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-xs);
  height: var(--control-xs);
  flex-shrink: 0;
  border: 2px solid var(--hairline);
  border-radius: 50%;
  background: var(--white);
}

.service-card.border-pink-500,
.date-btn.border-pink-500,
.time-slot.border-pink-500,
.waiting-time-slot.border-blue-500 {
  border-color: var(--brown) !important;
}

.service-card.bg-pink-50,
.date-btn.bg-pink-100,
.time-slot.bg-pink-100,
.waiting-time-slot.bg-blue-100 {
  background: var(--peach-deep) !important;
}

.service-card.border-pink-500 .book-radio {
  border-color: var(--brown);
  background: var(--brown);
  color: var(--white);
}

.book-client-grid {
  gap: var(--space-3);
  padding: 0 var(--card-pad) var(--card-pad);
}

.book-client-grid label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--brown-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.book-input,
.book-select,
.book-textarea {
  width: 100%;
  padding: var(--field-padding);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-2);
}

.book-input:focus,
.book-select:focus,
.book-textarea:focus {
  border-color: var(--brown);
}

#date-picker,
#time-slots,
#waiting-time-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  padding: 0 var(--card-pad) var(--card-pad);
}

.date-btn,
.time-slot,
.waiting-time-slot {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--brown);
  font-weight: 700;
}

.date-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  gap: var(--space-3);
  padding: var(--space-3);
}

.date-btn > span:first-child {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
}

.date-btn div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--brown-light);
  font-size: var(--text-xs);
  line-height: 1.2;
  text-transform: capitalize;
}

.time-slot,
.waiting-time-slot {
  padding: var(--slot-padding);
}

.book-summary {
  margin: 0;
}

.book-summary .book-confirm {
  padding: var(--card-pad);
}

.book-confirm {
  gap: var(--space-4);
}

.book-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.book-confirm-row > span:first-child {
  width: 88px;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.book-confirm-row > div {
  text-align: right;
}

.book-confirm-row b {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
}

.book-confirm-divider {
  height: var(--line-thin);
  background: var(--hairline);
}

.book-confirm-row.total b {
  font-size: var(--text-2xl);
  font-weight: 700;
}

.book-confirm-total {
  color: var(--brown);
}

.book-waiting-hint {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--peach);
  font-size: var(--text-xs);
}

.app-master-fixed {
  padding: 0 var(--card-pad) var(--card-pad);
  color: var(--brown-light);
}

.app-master-fixed p {
  margin: 0;
}

.app-master-fixed b {
  color: var(--brown);
}

.app-message {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--alert-bg);
  color: var(--alert);
  font-size: var(--text-sm);
}

.app-auth-card {
  margin: var(--space-6) var(--page-x);
  text-align: center;
}

.app-message-success {
  background: var(--success-glow);
  color: var(--success);
}

/* Auth & status screens (login, access blocked) */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: var(--space-6);
  padding: var(--space-8) var(--page-x);
  background: linear-gradient(180deg, var(--peach-deep) 0%, var(--bg) 55%);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--brown);
  font-size: var(--text-logo);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-brand-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--logo-size);
  height: var(--logo-size);
  border-radius: 50%;
  background: var(--brown);
  color: var(--cream);
  letter-spacing: 0;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-8) var(--panel-pad);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
}

.auth-icon-alert {
  background: var(--alert-bg);
  color: var(--alert);
}

.auth-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-3xl);
  line-height: 1.05;
}

.auth-text {
  margin: 0 auto var(--space-5);
  max-width: 40ch;
  color: var(--brown-light);
  font-size: var(--text-sm-plus);
  line-height: 1.55;
}

.auth-text:last-child {
  margin-bottom: 0;
}

.auth-vkid {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.auth-contacts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-5);
  text-align: left;
}

.auth-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.auth-contact > span {
  color: var(--brown-light);
  font-size: var(--text-sm);
  font-weight: 700;
}

.auth-contact a,
.auth-contact b {
  color: var(--brown);
  font-weight: 800;
}

.auth-card .btn {
  margin-top: var(--space-5);
}

.auth-back {
  color: var(--brown-light);
  font-size: var(--text-sm);
  font-weight: 600;
}

.auth-back:hover {
  color: var(--brown);
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: var(--space-5);
  overflow: auto;
  background: var(--overlay);
  backdrop-filter: blur(8px);
}

.app-modal-panel {
  max-width: 520px;
  margin: 10vh auto;
  padding: var(--panel-pad);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
}

.resch-current {
  padding: var(--space-4) var(--page-x) 0;
}

.resch-current-strike {
  position: relative;
  padding: var(--space-4);
  border: 1px solid var(--alert-border);
  border-radius: var(--radius-md);
  background: var(--alert-bg-soft);
}

.resch-current-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.resch-current-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  opacity: .72;
}

.resch-current-row h5,
.resch-current-row p {
  margin: 0;
  opacity: .72;
}

.resch-current-row h5 {
  font-size: var(--text-base);
  font-weight: 600;
}

.resch-current-row p {
  color: var(--brown-light);
  font-size: var(--text-xs);
}

.resch-current-strike::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-4);
  left: var(--space-4);
  height: var(--line-medium);
  border-radius: var(--line-medium);
  background: var(--alert-line);
  transform: translateY(8px) rotate(-1.5deg);
}

.resch-arrow {
  display: flex;
  justify-content: center;
  margin: var(--space-3) 0 calc(var(--space-1) * -1);
  color: var(--brown-light);
}

.succ-root {
  position: relative;
  padding: var(--space-8) var(--page-x);
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, var(--peach-deep) 0%, var(--bg) 60%);
}

.succ-check {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  margin: 0 auto var(--space-6);
}

.succ-check-ring {
  position: absolute;
  width: 92px;
  height: 92px;
  border: 2px solid var(--success);
  border-radius: 50%;
  animation: succBloom 2.6s var(--ease-out) infinite;
  opacity: 0;
}

.succ-check-ring:nth-child(2) { animation-delay: .85s; }
.succ-check-ring:nth-child(3) { animation-delay: 1.7s; }

@keyframes succBloom {
  0% { opacity: .5; transform: scale(.78); }
  100% { opacity: 0; transform: scale(1.65); }
}

.succ-check-svg {
  position: relative;
  width: 92px;
  height: 92px;
  animation: succPop .6s var(--ease-spring) both;
}

.succ-check-bg {
  fill: var(--success);
  opacity: .15;
}

.succ-check-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 2.5;
  opacity: .4;
}

.succ-check-tick {
  fill: none;
  stroke: var(--success);
  stroke-width: 4.5;
  stroke-dasharray: 56;
  stroke-dashoffset: 56;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: drawTick .42s var(--ease-out) .5s forwards;
}

@keyframes succPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

.succ-title {
  margin: 0 0 var(--space-3);
  font-size: clamp(38px, 9vw, 56px);
  font-weight: 600;
  line-height: 1;
}

.succ-sub {
  max-width: 36ch;
  margin: 0 auto var(--space-7);
  color: var(--brown-light);
}

.succ-card,
.succ-vk,
.succ-actions {
  width: 100%;
  max-width: 480px;
  margin-right: auto;
  margin-left: auto;
}

.succ-card {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--card-pad);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: left;
}

.succ-card-img {
  width: var(--avatar-md);
  height: var(--avatar-md);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--peach-deep);
}

.succ-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.succ-card-body {
  flex: 1;
  min-width: 0;
}

.succ-card-body h4 {
  margin: var(--space-1) 0 var(--space-3);
  font-size: var(--text-md);
  font-weight: 600;
}

.succ-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--brown-light);
  font-size: var(--text-xs);
}

.succ-card-grid > div,
.succ-card-foot,
.succ-vk {
  display: flex;
  align-items: center;
}

.succ-card-grid > div {
  min-width: 0;
  gap: var(--icon-gap);
}

.succ-card-grid span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.succ-card-foot {
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
}

.succ-card-foot span {
  color: var(--brown-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.succ-card-foot b {
  font-size: var(--text-xl);
  font-weight: 700;
}

.succ-vk {
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--vk-start) 0%, var(--vk-end) 100%);
  color: var(--white);
  text-align: left;
}

.succ-vk b,
.succ-vk span {
  display: block;
}

.succ-vk span {
  color: var(--white-muted-alt);
  font-size: var(--text-xs);
}

.succ-vk > svg:last-child {
  margin-left: auto;
}

.succ-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.succ-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.succ-confetti-bit {
  position: absolute;
  top: -10%;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    opacity: .2;
    transform: translateY(110vh) rotate(720deg);
  }
}

@media (min-width: 720px) {
  #date-picker,
  #time-slots,
  #waiting-time-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
