/* ==========================================================================
   تالار پالادین — reservation.css
   صفحهٔ رزرو نوبت + تقویم کاغذی فارسی (الگوگرفته از paper-calendar)
   ========================================================================== */

.res-body {
  background: var(--ivory);
}

.res-main {
  padding-top: clamp(92px, 11vh, 130px);
  padding-bottom: clamp(64px, 8vw, 120px);
}

/* ---------------- سرصفحه ---------------- */
.res-hero {
  position: relative;
  padding-block: clamp(28px, 4vw, 56px) clamp(24px, 3vw, 44px);
  overflow: hidden;
}
.res-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--pattern) center / 64px;
  opacity: 0.08;
  -webkit-mask-image: radial-gradient(70% 80% at 50% 40%, #000 0, transparent 100%);
  mask-image: radial-gradient(70% 80% at 50% 40%, #000 0, transparent 100%);
}
.res-hero__inner {
  position: relative;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.res-hero__inner .eyebrow {
  margin-bottom: 0;
}
.res-hero__title {
  font-size: clamp(34px, 4.8vw, 66px);
  max-width: 18ch;
}
.res-hero__lead {
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.3vw, 17.5px);
}

/* ---------------- چیدمان دو ستونی ---------------- */
.res-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(24px, 3.5vw, 48px);
  align-items: start;
}

.res-grid[hidden] {
  display: none;
}

.res-flow {
  display: grid;
  gap: 24px;
}

/* سوئیچ نوع درخواست (رزرو / بازدید حضوری) */
.res-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px;
  border-radius: 24px;
  background: var(--ivory-200);
  box-shadow: inset 0 0 0 1px var(--line-gold);
}

.res-mode__opt {
  position: relative;
  cursor: pointer;
  border-radius: 18px;
  padding: 14px 18px;
  transition: background-color 0.3s, box-shadow 0.3s, transform 0.25s var(--ease);
}

.res-mode__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.res-mode__opt span {
  display: grid;
  gap: 2px;
}

.res-mode__opt strong {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.35;
  color: var(--charcoal);
}

.res-mode__opt small {
  font-size: 13px;
  color: var(--ink-soft);
}

.res-mode__opt:has(input:checked) {
  background: var(--burgundy);
  box-shadow: 0 12px 26px -14px rgba(116, 31, 43, 0.75);
}

.res-mode__opt:has(input:checked) strong {
  color: var(--ivory);
}

.res-mode__opt:has(input:checked) small {
  color: var(--gold-300);
}

@media (max-width: 560px) {
  .res-mode {
    grid-template-columns: 1fr;
  }
}

/* کارت‌های فرم */
.res-card {
  padding: clamp(22px, 2.8vw, 34px);
  border-radius: 28px;
  background: #fcfaf6;
  box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -36px rgba(41, 39, 39, 0.25);
}

.res-card__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.res-step {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--burgundy);
  color: var(--gold-300);
  font-family: var(--f-display);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 0 0 4px var(--ivory), 0 0 0 5px var(--line-gold);
}

.res-card__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.4;
  color: var(--charcoal);
}

.res-card__sub {
  font-size: 14.5px;
  color: var(--ink-soft);
}

/* ---------------- انتخاب نوع مراسم ---------------- */
.svc-picker {
  display: grid;
  gap: 12px;
}

.svc-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--ivory);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.3s;
}

.svc-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.svc-opt__img {
  width: 74px;
  height: 60px;
  flex: none;
  border-radius: 14px;
  background-color: var(--burgundy-700);
  background-image: var(--img, none), linear-gradient(145deg, var(--burgundy), var(--burgundy-900));
  background-size: cover;
  background-position: center;
  transition: transform 0.5s var(--ease);
}

.svc-opt__info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.svc-opt__info strong {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.35;
  color: var(--charcoal);
}

.svc-opt__info small {
  font-size: 13.5px;
  color: var(--ink-soft);
}

.svc-opt__check {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.35s var(--ease);
}

@media (hover: hover) {
  .svc-opt:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px var(--gold), 0 12px 26px -18px rgba(116, 31, 43, 0.35);
  }
  .svc-opt:hover .svc-opt__img {
    transform: scale(1.04);
  }
}

.svc-opt.is-selected,
.svc-opt:has(input:checked) {
  background: #fffdf9;
  box-shadow: inset 0 0 0 2px var(--burgundy), 0 16px 32px -20px rgba(116, 31, 43, 0.45);
}

.svc-opt.is-selected .svc-opt__check,
.svc-opt:has(input:checked) .svc-opt__check {
  background: var(--burgundy);
  color: var(--gold-300);
  box-shadow: none;
  transform: scale(1.06);
}

.svc-opt:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------- فیلدها و قرص‌های انتخاب ---------------- */
.res-fields {
  display: grid;
  gap: 20px;
}

.field-group {
  display: grid;
  gap: 10px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--charcoal);
}

.field-label .ico {
  color: var(--burgundy);
}

.field-label em {
  font-style: normal;
  color: var(--burgundy);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-opt {
  position: relative;
  cursor: pointer;
}

.pill-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-opt span {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: var(--ivory);
  color: var(--charcoal);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}

.pill-opt:hover span {
  box-shadow: inset 0 0 0 1px var(--gold);
}

.pill-opt input:checked + span {
  background: var(--burgundy);
  color: var(--ivory);
  box-shadow: 0 8px 20px -10px rgba(116, 31, 43, 0.7);
}

.pill-opt input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.res-inputs-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.res-input {
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--f-body);
  font-size: 15.5px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.25s, background-color 0.25s;
}

.res-input:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--burgundy);
}

.res-textarea {
  resize: vertical;
  min-height: 92px;
}

.res-error {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(116, 31, 43, 0.1);
  color: var(--burgundy);
  font-size: 14px;
  font-weight: 600;
}

/* ---------------- ستون کناری (تقویم کاغذی + خلاصه) ---------------- */
.res-aside {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 20px;
}

.cal-stage {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 2.8vw, 30px) clamp(16px, 2.2vw, 24px) 26px;
  border-radius: 30px;
  background: radial-gradient(100% 90% at 50% 0%, #4e141f, var(--burgundy-900) 70%, #24080e);
  color: var(--ivory);
  box-shadow: inset 0 0 0 1px var(--line-gold), 0 30px 60px -30px rgba(27, 25, 25, 0.7);
}

.cal-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pattern) center / 64px;
  opacity: 0.08;
  pointer-events: none;
}

.cal-stage__head {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
  display: grid;
  gap: 4px;
}

.cal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gold-300);
}

.cal-hint {
  font-size: 12.5px;
  color: rgba(247, 244, 238, 0.65);
}

/* ---------------- تقویم کاغذی (Paper Calendar - Jalali RTL) ---------------- */
.calendar {
  --cal-paper: #f7f3ea;
  --cal-paper-back: #e6decd;
  --cal-ink: #1f1a17;
  --cal-red: #8e2332;
  --cal-muted: rgba(31, 26, 23, 0.48);
  --depth: 1600px;

  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.calendar__nav {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.calendar__picked-pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-300);
  background: rgba(247, 244, 238, 0.08);
  box-shadow: inset 0 0 0 1px rgba(197, 161, 91, 0.4);
  white-space: nowrap;
}

.calendar__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(247, 244, 238, 0.35);
  color: var(--ivory);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: box-shadow 0.25s ease, background-color 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.6, 0.5, 1);
}

.calendar__arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
  .calendar__arrow:hover {
    background: rgba(197, 161, 91, 0.18);
    box-shadow: inset 0 0 0 1.5px var(--gold);
    transform: translateY(-2px);
  }
}

.calendar__arrow:active {
  transform: scale(0.94);
}

.pad {
  position: relative;
  width: min(390px, 100%);
  aspect-ratio: 0.86;
  touch-action: none;
}

/* لبهٔ برگ‌های زیرین */
.pad::before,
.pad::after {
  content: '';
  position: absolute;
  left: 2.5%;
  right: 2.5%;
  bottom: -5px;
  height: 20px;
  border-radius: 0 0 10px 10px;
  background: #d8cfbd;
}

.pad::after {
  left: 5%;
  right: 5%;
  bottom: -10px;
  background: #b9b09f;
}

.pad__sheets {
  position: absolute;
  inset: 0;
  z-index: 1;
  perspective: var(--depth);
  perspective-origin: 50% 0%;
}

/* برگ ماه */
.cal-sheet {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12% 7% 5.5%;
  border-radius: 6px 6px 12px 12px;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 60%),
    var(--cal-paper);
  color: var(--cal-ink);
  box-shadow: 0 26px 50px -24px rgba(0, 0, 0, 0.85);
  transform-origin: 50% 0;
}

.cal-sheet__shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.15));
  opacity: 0;
  pointer-events: none;
}

.cal-sheet__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0.35em;
}

.cal-sheet__month {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-synthesis: none;
  font-size: clamp(32px, 5.2vw, 48px);
  line-height: 1.15;
  color: var(--cal-ink);
}

.cal-sheet__year {
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 700;
  color: var(--cal-muted);
}

.cal-sheet__week,
.cal-sheet__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-sheet__week {
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(31, 26, 23, 0.14);
  margin-bottom: 0.35em;
  font-size: clamp(11.5px, 1.5vw, 13px);
  font-weight: 700;
  text-align: center;
  color: var(--cal-muted);
}

.cal-sheet__week .is-friday {
  color: var(--cal-red);
}

.cal-sheet__days {
  flex: 1;
  grid-template-rows: repeat(6, 1fr);
}

.cal-date {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cal-ink);
  font-family: var(--f-body);
  font-size: clamp(15px, 2.2vw, 19px);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.2s ease, transform 0.35s cubic-bezier(0.34, 1.6, 0.5, 1);
}

.cal-date.is-friday {
  color: var(--cal-red);
}

.cal-date.is-past {
  opacity: 0.28;
  cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
  .cal-date:not(:disabled):hover {
    transform: translateY(-2px) rotate(-4deg);
  }
}

.cal-date:focus-visible {
  outline: 2px dashed var(--cal-ink);
  outline-offset: -4px;
}

/* حلقهٔ دست‌نویس دور روز انتخاب‌شده */
.cal-sheet__ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: var(--cal-red);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.cal-sheet__ink path {
  opacity: 0.92;
}

/* پشت برگ در حال چرخش */
.flip {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.flip .cal-sheet {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip__back {
  position: absolute;
  inset: 0;
  border-radius: 12px 12px 6px 6px;
  background: var(--cal-paper-back);
  transform: rotateX(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* فنر فلزی بالای تقویم */
.pad__wire {
  position: absolute;
  left: 4%;
  right: 4%;
  top: -14px;
  z-index: 4;
  width: 92%;
  height: 34px;
  overflow: visible;
  pointer-events: none;
}

/* ---------------- کارت خلاصهٔ رزرو ---------------- */
.res-summary {
  padding: clamp(20px, 2.5vw, 28px);
  border-radius: 26px;
  background: #fcfaf6;
  box-shadow: inset 0 0 0 1px var(--line-gold), 0 20px 50px -30px rgba(41, 39, 39, 0.3);
  display: grid;
  gap: 16px;
}

.res-summary__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.4;
  color: var(--burgundy);
}

.res-summary__list {
  display: grid;
  gap: 10px;
  font-size: 14.5px;
}

.res-summary__list div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.res-summary__list dt {
  color: var(--ink-soft);
}

.res-summary__list dd {
  font-weight: 700;
  color: var(--charcoal);
  text-align: end;
}

.res-submit {
  width: 100%;
}

.res-summary__note {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------------- صفحهٔ تایید ثبت ---------------- */
.res-done {
  max-width: 680px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 56px);
  border-radius: 32px;
  background: #fcfaf6;
  box-shadow: inset 0 0 0 1px var(--line-gold), 0 30px 70px -36px rgba(116, 31, 43, 0.35);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 16px;
}

.res-done[hidden] {
  display: none;
}

.res-done__icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--burgundy);
  color: var(--gold-300);
  box-shadow: 0 0 0 8px var(--ivory), 0 0 0 9px var(--line-gold);
}

.res-done__icon .ico {
  width: 32px;
  height: 32px;
}

.res-done__title {
  font-size: clamp(28px, 4vw, 48px);
}

.res-done__desc {
  max-width: 48ch;
  color: var(--ink-soft);
  font-size: 16px;
}

.res-done__code {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--ivory-200);
  box-shadow: inset 0 0 0 1px var(--line-gold);
  font-size: 15px;
}

.res-done__code strong {
  color: var(--burgundy);
  font-family: var(--f-display);
  font-size: 20px;
  margin-inline-start: 6px;
}

.res-done__actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------------- واکنش‌گرایی ---------------- */
@media (max-width: 980px) {
  .res-grid {
    grid-template-columns: 1fr;
  }
  .res-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .res-inputs-2 {
    grid-template-columns: 1fr;
  }
  .svc-opt {
    padding: 10px 12px;
    gap: 12px;
  }
  .svc-opt__img {
    width: 60px;
    height: 52px;
  }
}
