/* Mirapages — booking sheet, calendar, form, manage page. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sheet { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; justify-items: center; }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(15, 13, 9, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .45s var(--ease); }
.sheet.is-open .sheet__scrim { opacity: 1; }
.sheet__panel {
  position: relative; width: min(100%, 640px); height: min(92svh, 860px);
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--bone); color: var(--ink);
  border-radius: 48% 48% 0 0 / 56px 56px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .35);
  transform: translateY(102%);
  transition: transform .6s var(--ease);
  overflow: hidden;
}
.sheet.is-open .sheet__panel { transform: none; }
@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet__panel { border-radius: 320px 320px 28px 28px / 64px 64px 28px 28px; transform: translateY(40px) scale(.97); opacity: 0; transition: transform .55s var(--ease), opacity .35s; }
  .sheet.is-open .sheet__panel { transform: none; opacity: 1; }
}
.sheet__head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: 28px 18px 14px; position: relative; text-align: center; }
.sheet__step { font-size: .8125rem; color: var(--copper-deep); font-weight: 600; }
.sheet__title { font: italic 600 clamp(1.5rem, 4vw, 2rem)/1.1 var(--serif); }
:lang(zh) .sheet__title { font: 700 1.5rem/1.2 var(--sans); }
.sheet__bar { position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px; background: rgba(29, 26, 20, .08); overflow: hidden; }
.sheet__bar span { display: block; height: 100%; background: var(--copper); transform-origin: left; transform: scaleX(.25); transition: transform .6s var(--ease); }
.icon-btn--ink { border-color: rgba(29, 26, 20, .18); color: var(--ink); }
.icon-btn--ink:hover { border-color: var(--copper-deep); background: rgba(154, 95, 60, .08); }
.icon-btn--ink:disabled { opacity: .3; cursor: not-allowed; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 28px; -webkit-overflow-scrolling: touch; }
.sheet__foot { display: grid; gap: 10px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(29, 26, 20, .1); background: var(--bone); }
.sheet__summary { min-height: 1.3em; font-size: .875rem; color: rgba(29, 26, 20, .7); text-align: center; }
.sheet__primary { width: 100%; }
.sheet .btn--ghost { color: var(--ink); border-color: rgba(29, 26, 20, .2); }
.sheet .btn--ghost:hover { border-color: var(--copper-deep); color: var(--copper-deep); }
body.sheet-open { overflow: hidden; }

/* step transitions */
.step--fwd { animation: stepFwd .5s var(--ease); }
.step--back { animation: stepBack .5s var(--ease); }
@keyframes stepFwd { from { opacity: 0; transform: translateX(40px); } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-40px); } }

/* services picker */
.pick__group { font: 600 .8125rem/1 var(--sans); color: var(--copper-deep); margin: 22px 0 10px; letter-spacing: .02em; }
.pick__group:first-child { margin-top: 0; }
.pick__list { display: grid; gap: 8px; }
.pick {
  display: grid; grid-template-columns: 1fr 28px; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
  text-align: left; padding: 14px 16px; border-radius: 18px;
  border: 1.5px solid rgba(29, 26, 20, .12); background: #fff8ef; cursor: pointer; color: var(--ink);
  transition: border-color .25s, background-color .25s, transform .2s var(--ease);
}
.pick:hover { border-color: var(--copper); }
.pick:active { transform: scale(.985); }
.pick:disabled { opacity: .4; cursor: not-allowed; }
.pick__name { font-weight: 600; }
.pick__meta { grid-row: 2; font-size: .8125rem; color: rgba(29, 26, 20, .6); }
.pick__check { grid-row: 1 / 3; grid-column: 2; align-self: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(29, 26, 20, .2); position: relative; transition: background-color .3s var(--ease), border-color .3s; }
.pick__check::after { content: ""; position: absolute; left: 9px; top: 5px; width: 6px; height: 11px; border: solid var(--bone); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .35s var(--ease); }
.pick.is-on { border-color: var(--copper); background: rgba(196, 131, 90, .12); }
.pick.is-on .pick__check { background: var(--copper); border-color: var(--copper); }
.pick.is-on .pick__check::after { transform: rotate(45deg) scale(1); }
.pick__max { margin-top: 18px; font-size: .8125rem; color: rgba(29, 26, 20, .6); text-align: center; }

/* calendar */
.cal__head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 14px; }
.cal__title { text-align: center; font-weight: 700; font-size: 1.0625rem; }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__dow span { text-align: center; font-size: .75rem; color: rgba(29, 26, 20, .5); padding-bottom: 6px; }
.cal__grid.is-anim-l { animation: stepFwd .4s var(--ease); }
.cal__grid.is-anim-r { animation: stepBack .4s var(--ease); }
.cal__day {
  aspect-ratio: 1; min-height: 40px; width: 100%; max-width: 52px; justify-self: center; border-radius: 50%; border: 1.5px solid transparent;
  background: transparent; color: rgba(29, 26, 20, .3); font-weight: 600; font-size: .9375rem; cursor: default;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--ease);
  font-variant-numeric: tabular-nums;
}
.cal__day.is-loading { animation: pulse 1.2s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 20ms); }
@keyframes pulse { to { opacity: .45; } }
.cal__day.is-free { color: var(--ink); background: #fff8ef; border-color: rgba(196, 131, 90, .35); cursor: pointer; animation: dayIn .45s var(--ease) both; animation-delay: calc(var(--i) * 12ms); }
@keyframes dayIn { from { opacity: 0; transform: scale(.7); } }
.cal__day.is-free:hover { border-color: var(--copper); }
.cal__day.is-today { box-shadow: inset 0 0 0 1px rgba(29, 26, 20, .3); }
.cal__day.is-selected { background: var(--copper); border-color: var(--copper); color: var(--ink); transform: scale(1.08); }
.cal__note { margin-top: 12px; font-size: .875rem; color: rgba(29, 26, 20, .65); text-align: center; min-height: 1.2em; }
.cal__note.is-error, .form-error { color: #9b2c1d; }
.legend { display: flex; justify-content: center; gap: 18px; margin-top: 8px; font-size: .75rem; color: rgba(29, 26, 20, .6); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend__free::before { background: #fff8ef; border: 1.5px solid var(--copper); }
.legend__full::before { background: rgba(29, 26, 20, .12); }
.slots { margin-top: 22px; display: grid; gap: 10px; }
.slots__label { font-size: .8125rem; font-weight: 600; color: var(--copper-deep); }
.slots__row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  min-width: 76px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid rgba(29, 26, 20, .15); background: #fff8ef; cursor: pointer; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
  animation: dayIn .4s var(--ease) both; animation-delay: calc(var(--i) * 30ms);
  transition: background-color .25s, border-color .25s, transform .25s var(--ease);
}
.slot:hover { border-color: var(--copper); }
.slot.is-selected { background: var(--ink); color: var(--bone); border-color: var(--ink); transform: scale(1.04); }
.slots__ends { font-size: .875rem; color: rgba(29, 26, 20, .65); min-height: 1.2em; }
.slots__loading { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.slots__loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--copper); animation: dot .9s ease-in-out infinite alternate; }
.slots__loading span:nth-child(2) { animation-delay: .15s; }
.slots__loading span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { to { transform: translateY(-6px); opacity: .4; } }

/* form */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .875rem; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.field__opt { font-weight: 500; color: rgba(29, 26, 20, .5); font-size: .8125rem; }
.field input:not([type="checkbox"]):not([type="file"]), .field textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 16px;
  border: 1.5px solid rgba(29, 26, 20, .15); background: #fff8ef; color: var(--ink);
  font: 500 1rem/1.4 var(--sans); transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 4px rgba(196, 131, 90, .2); }
.field.has-error input:not([type="checkbox"]):not([type="file"]), .field.has-error textarea, .field.has-error .photo { border-color: #b4412f; background: #fff4f1; }
.field.has-error .check__box { border-color: #b4412f; }
.field__err { font-size: .8125rem; color: #9b2c1d; animation: stepFwd .3s var(--ease); }
.field__link { font-size: .875rem; color: var(--copper-deep); }
.photo {
  display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 14px;
  padding: 12px; border-radius: 20px; border: 1.5px dashed rgba(29, 26, 20, .25); background: #fff8ef; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.photo:hover { border-color: var(--copper); }
.photo.is-busy { opacity: .6; }
.photo__plus, .photo__img { width: 72px; height: 72px; border-radius: 36px 36px 10px 10px; }
.photo__plus { display: grid; place-items: center; background: rgba(196, 131, 90, .15); color: var(--copper-deep); font-size: 2rem; }
.photo__img { object-fit: cover; animation: dayIn .45s var(--ease); }
.photo__text { display: grid; gap: 2px; font-size: .875rem; color: rgba(29, 26, 20, .65); }
.photo__text b { color: var(--ink); font-size: .9375rem; }
#f-photo:focus-visible + .photo { outline: 2px solid var(--copper); outline-offset: 3px; }
.field--check { gap: 8px; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; cursor: pointer; font-size: .9375rem; }
.check input { position: absolute; opacity: 0; width: 26px; height: 26px; margin: 0; }
.check__box { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid rgba(29, 26, 20, .3); background: #fff8ef; position: relative; transition: background-color .25s, border-color .25s; }
.check__box::after { content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid var(--bone); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .3s var(--ease); }
.check input:checked + .check__box { background: var(--copper-deep); border-color: var(--copper-deep); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--copper); outline-offset: 2px; }

/* review */
.review-list { margin: 0; display: grid; }
.review-row { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid rgba(29, 26, 20, .1); }
.review-row dt { font-size: .8125rem; color: var(--copper-deep); font-weight: 600; }
.review-row dd { margin: 0; display: flex; justify-content: space-between; gap: 12px; white-space: pre-line; font-weight: 600; }
.review-row__edit { flex: none; align-self: start; border: 0; background: none; color: var(--copper-deep); font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.deposit { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px; border-radius: 22px; background: var(--olive); color: var(--bone); }
.deposit__amount { font: italic 600 2rem/1 var(--serif); color: var(--copper-hi); }
.deposit p { font-size: .9375rem; }
.form-error { margin-top: 16px; font-weight: 600; }

/* done */
.done { display: grid; justify-items: center; text-align: center; gap: 8px; padding-top: 6px; }
.done__check { width: 84px; height: 84px; margin-bottom: 6px; }
.done__check circle { fill: none; stroke: var(--copper); stroke-width: 3; stroke-dasharray: 227; stroke-dashoffset: 227; animation: draw .8s var(--ease) .1s forwards; }
.done__check path { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s var(--ease) .75s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__label { font-size: .8125rem; color: rgba(29, 26, 20, .6); }
.done__ref { font: 700 clamp(2rem, 7vw, 2.75rem)/1 var(--sans); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.done__status { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(196, 131, 90, .18); color: var(--copper-deep); font-weight: 600; font-size: .875rem; margin-top: 4px; }
.done__when { font-weight: 600; margin-top: 6px; }
.deposit--done { text-align: left; width: 100%; }
.done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.done__keep { font-size: .8125rem; color: rgba(29, 26, 20, .6); margin-top: 8px; }

.toast { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bone); font-size: .875rem; font-weight: 600; animation: toastIn .4s var(--ease); transition: opacity .4s, transform .4s var(--ease); }
.toast.is-out { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } }

/* manage page */
.manage { min-height: 100svh; display: grid; place-items: center; padding: 100px var(--gutter) 60px; }
.manage__card { width: min(100%, 560px); background: var(--bone); color: var(--ink); border-radius: 280px 280px 28px 28px / 64px 64px 28px 28px; padding: 44px 24px 28px; display: grid; gap: 16px; }
.manage__card h1 { font: italic 600 2rem/1.1 var(--serif); text-align: center; }
:lang(zh) .manage__card h1 { font: 700 1.625rem/1.2 var(--sans); }
.manage__actions { display: grid; gap: 10px; margin-top: 8px; }
.manage__msg { padding: 14px 16px; border-radius: 16px; background: rgba(196, 131, 90, .14); font-size: .9375rem; }
.manage__card .btn--ghost { color: var(--ink); border-color: rgba(29, 26, 20, .2); }
.manage__card textarea { width: 100%; min-height: 80px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(29, 26, 20, .15); background: #fff8ef; font: 500 1rem var(--sans); }
.btn--danger { background: #9b2c1d; color: #fff; }
.btn--danger:hover { background: #b4412f; }

@media (max-width: 420px) {
  .sheet__body { padding-inline: 16px; }
  .sheet__foot { padding-inline: 16px; }
  .cal__dow, .cal__grid { gap: 4px; }
  .slot { min-width: 68px; }
}
.still .done__check circle, .still .done__check path { stroke-dashoffset: 0; }
