/* Билетный стиль в духе рукописного приглашения: карточка с перфорацией между
   шапкой и деталями, пунктирными разделителями и шрифтом PT Mono везде —
   как в макете (Figma: Android Medium - 3). */

:root {
  --ink: #151519;
  --muted: #AAAAAA;
  --accent: #D2373A;
  --accent-2: #D2373A;
  --line: #D2373A;
  --paper: #F8F8F8;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

/* Классовые display-правила ниже (.choice, .block и т.п.) равны по специфичности
   [hidden] и идут в каскаде позже — без !important они бы перебивали скрытие,
   назначаемое через JS. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 40px 16px 80px;
  background: var(--paper);
  /* background-image:
    radial-gradient(circle at 20% 10%, #f4f1ea 0%, transparent 45%),
    radial-gradient(circle at 80% 90%, #e8e3d8 0%, transparent 45%); */
  color: var(--ink);
  font-family: 'PT Mono', monospace;
  font-size: 15px;
  line-height: 1.2;
}

.page {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  overflow: visible;
  padding: 30px 20px;
  background: #fff;
}

.page-div {
  position: relative;
}

.top-scallop,
.bottom-scallop {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 3;
  pointer-events: none;
}

.top-scallop {
  top: -50px;
}

.bottom-scallop {
  bottom: -50px;
}

.top-scallop span,
.bottom-scallop span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
}

/* Карточка — самостоятельный «билет» со своей рамкой. Несколько секций
   внутри одной карточки разделяются точечной линией (см. .extra), а между
   карточками — перфорированный шов (.seam). */
.card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 26px;
  padding: 30px 32px;
}

.section {
  position: relative;
  padding: 0;
}

/* Перфорированный шов между карточками — пунктирная линия с двумя
   кружками-«дыроколами» цвета фона страницы. */
.seam {
  position: relative;
  height: 56px;
  margin: 4px 0;
}

.seam::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--line);
}

.seam:has(+ [hidden]) {
  display: none;
}

.hole {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  background: var(--paper);
  border-radius: 50%;
}

.hole-left {
  left: -45px;
}

.hole-right {
  right: -45px;
}

/* Точечный разделитель между секциями внутри одной карточки (дресс-код /
   заметки / личная приписка гостю) — только когда обе видимы. */
.extra {
  margin: 0;
}

.extra:not([hidden])~.extra:not([hidden]) {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dotted var(--line);
}

.guest-note {
  font-size: 16px;
}

h1 {
  margin: 0;
  font-family: 'PT Mono', monospace;
  font-weight: 700;
  font-size: 35px;
  line-height: 1.1;
  color: #36363B;
  text-align: center;
}

.greeting {
  margin: 28px 0 0;
  color: var(--accent);
  font-family: 'PT Mono', monospace;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: normal;
  text-transform: none;
}

.date-hero {
  margin-bottom: 24px;
  text-align: center;
}

#ceremony-block,
#banquet-block {
  margin-top: 30px;
}

.date-heading {
  margin: 0 0 20px;
  font-weight: 700;
  font-size: 32px;
}

.mini-calendar {
  display: flex;
  justify-content: space-between;
  max-width: 320px;
  margin: 0 auto;
}

.mini-calendar .day {
  min-width: 24px;
  color: var(--muted);
  font-size: 18px;
}

.mini-calendar .day.event {
  color: var(--accent);
  font-size: 32px;
  line-height: 1;
  display: inline-block;
  transform: rotate(30deg);
}

.intro {
  margin: 18px 0 0;
  font-size: 16px;
  line-height: 1.4;
}

.note {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: rgba(210, 55, 58, .06);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 15px;
}

.hint {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

h2 {
  margin: 0 0 18px;
  text-align: center;
  font-family: 'PT Mono', monospace;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: normal;
  text-transform: none;
  color: #36363B;
}

h2::before {
  content: "";
}

#dresscode-title {
  color: var(--accent);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  margin-bottom: 16px;
  font-size: 16px;
  white-space: pre-line;
}

.plain-list li:last-child {
  margin-bottom: 0;
}

#notes-list li:not(:first-child) {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dotted var(--line);
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  margin: 4px 0 0;
  border-top: 1px dotted #eee6d8;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px dotted #eee6d8;
  font-size: 16px;
}

.facts dt {
  padding-right: 20px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}

.facts dd {
  font-weight: 400;
  text-align: right;
}

.facts dd.accent {
  color: var(--accent);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* --- Форма --- */

.field {
  margin: 0 0 26px;
  padding: 0;
  border: none;
}

.field>label,
legend {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font-family: 'PT Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}

.choice {
  display: block;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 16px;
}

.choice input {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  vertical-align: -3px;
  accent-color: var(--accent);
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #eee6d8;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font-family: 'PT Mono', monospace;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(210, 55, 58, .12);
}

#allergy {
  margin-top: 10px;
}

button {
  padding: 14px 34px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: 'PT Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(210, 55, 58, .6);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: .6;
  cursor: default;
}

.link-button {
  padding: 0;
  background: none;
  color: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: rgba(210, 55, 58, .08);
  border-radius: 6px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
}

/* Экран после отправки — как оторванный контрольный купон билета */
.done {
  text-align: center;
  background: var(--accent);
  color: #fff;
  margin: -30px -32px;
  padding: 34px 34px 38px;
  border-radius: 26px;
}

.done h2 {
  color: #fff;
  margin-bottom: 10px;
}

.done h2::before {
  content: "";
}

.done p {
  margin: 0 0 16px;
  opacity: .95;
  font-size: 16px;
}

.done .link-button {
  color: #fff;
}

.done::after {
  content: "";
  display: block;
  height: 22px;
  margin-top: 18px;
  opacity: .55;
  background-image: repeating-linear-gradient(90deg,
      rgba(255, 255, 255, .85) 0 2px, transparent 2px 5px,
      rgba(255, 255, 255, .85) 5px 6px, transparent 6px 11px,
      rgba(255, 255, 255, .85) 11px 14px, transparent 14px 17px);
}

.loading {
  max-width: 560px;
  margin: 80px auto;
  padding: 0 16px;
  color: var(--muted);
  text-align: center;
  font-family: 'PT Mono', monospace;
  font-size: 16px;
}

@media (max-width: 480px) {
  .card {
    padding: 24px 22px;
  }

  .done {
    margin: -24px -22px;
  }

  h1 {
    font-size: 29px;
  }

  .seam {
    height: 40px;
  }

  .hole {
    width: 36px;
    height: 36px;
    margin-top: -18px;
  }
}

/* Крючок для персональных вариантов оформления: theme в guests.json
   превращается в класс на <body>, например .theme-family */