:root {
  --night: #17130e;
  --night-2: #221c15;
  --cream: #f3ecdf;
  --cream-2: #e9dfcc;
  --paper: rgba(246, 239, 226, 0.94);
  --ink: #2b241b;
  --ink-soft: #6b5f4f;
  --gold: #d9b779;
  --gold-deep: #a9824d;
  --olive: #55603f;
  --olive-deep: #424b30;
  --error: #b5513f;
  --ok: #5d7a46;
  --radius: 14px;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --script: 'Marck Script', 'Segoe Script', cursive;
  --sans: 'Manrope', 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream);
  background: var(--night);
}

.bg-photo {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.bg-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 19, 14, 0.55) 0%, rgba(23, 19, 14, 0.82) 45%, rgba(23, 19, 14, 0.94) 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 82% 6%, rgba(217, 183, 121, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 8% 60%, rgba(85, 96, 63, 0.28), transparent 70%);
}

.has-photo .bg-glow { opacity: 0.6; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

/* ---- Brand ---- */
.brand { text-align: center; margin-bottom: 26px; }

.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--cream);
}

.brand-name::after {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  margin: 6px auto 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

.brand-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 236, 223, 0.7);
}

/* ---- Hero ---- */
.hero { text-align: center; margin-bottom: 26px; }

.hero-script {
  font-family: var(--script);
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1;
  color: var(--gold);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(64px, 19vw, 118px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 4px 0 14px;
  color: var(--cream);
}

.pill {
  display: inline-block;
  background: var(--olive);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 26px;
  border-radius: 999px 6px 999px 6px;
}

.greeting {
  font-size: 19px;
  font-weight: 600;
  margin: 18px 0 6px;
}

.hero-text {
  max-width: 520px;
  margin: 12px auto 0;
  color: rgba(243, 236, 223, 0.85);
}

.date-badge {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 22px;
  border: 1px solid rgba(217, 183, 121, 0.55);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 600;
  font-size: 15px;
  background: rgba(23, 19, 14, 0.4);
}

.date-badge-lg { font-size: 18px; padding: 12px 26px; }
.date-sep { opacity: 0.6; }

.hero-compact { margin-bottom: 20px; }
.hero-compact .hero-script { font-size: 34px; }

/* ---- Invitation: menu + facts ---- */
.invite-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
  align-items: start;
}

.menu-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.menu-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--olive-deep);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(66, 75, 48, 0.25);
}

.menu-pill {
  display: inline-block;
  background: var(--olive);
  color: var(--cream);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 999px 4px 999px 4px;
  margin: 8px 0 4px;
}

.menu-list {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}

.menu-list li {
  padding: 6px 0;
  font-size: 15px;
}

.menu-list li.menu-divider {
  padding: 0;
  height: 1px;
  margin: 6px 0;
  background: rgba(66, 75, 48, 0.2);
}

.facts { display: flex; flex-direction: column; gap: 16px; }

.fact {
  border: 1px solid rgba(217, 183, 121, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: rgba(23, 19, 14, 0.55);
}

.fact-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 236, 223, 0.65);
}

.fact-price {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 54px;
  line-height: 1.05;
  color: var(--cream);
}

.fact-sub { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(243, 236, 223, 0.65); }
.fact-value { font-size: 16px; font-weight: 600; margin-top: 4px; }

.fact-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
}

.fact-link:hover { text-decoration: underline; }

/* ---- Panels / forms ---- */
.panel {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.panel-center { text-align: center; }

.panel-title {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.tiny { font-size: 11px; margin: 10px 0 0; text-align: center; }

.reg-form { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field input {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* 16px — чтобы iPhone не увеличивал страницу при фокусе */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #d6cbb6;
  border-radius: 10px;
  padding: 12px 14px;
}

.field input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(169, 130, 77, 0.2);
}

.field input.invalid { border-color: var(--error); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.guests-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid #d6cbb6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.stepper-btn {
  width: 46px;
  border: none;
  background: var(--cream-2);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}

.stepper-btn:hover { background: #ddd0b8; }

.stepper input {
  width: 56px;
  border: none;
  text-align: center;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.total { font-size: 15px; color: var(--ink-soft); }
.total strong { color: var(--ink); font-size: 20px; }

.form-error {
  background: #f6e1dc;
  color: var(--error);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.form-error[hidden] { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 26px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary { background: var(--olive-deep); color: var(--cream); }
.btn-primary:hover { background: var(--olive); }
.btn-primary:disabled { opacity: 0.45; cursor: default; }
.btn-wide { width: 100%; }

.btn-sbp {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, #1d7a43, #2c9a56);
  color: #fff;
}

.btn-sbp:hover { opacity: 0.92; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid #d6cbb6;
  margin-top: 10px;
}

.btn-copy {
  border: 1.5px solid #d6cbb6;
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-copy.copied { border-color: var(--ok); color: var(--ok); }

/* ---- Registration status page ---- */
.reg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0d6c3;
  margin-bottom: 18px;
}

.reg-name { font-size: 19px; font-weight: 700; }

.status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-new { background: #f1e3c6; color: #8a6a2f; }
.status-review { background: #e4e8f3; color: #3f5287; }
.status-paid { background: #dfe9d6; color: var(--ok); }
.status-cancelled { background: #f1dcd7; color: var(--error); }

.notice {
  background: #efe6d4;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  margin: 0 0 16px;
}

.notice-ok { background: #e3ecd9; color: #3e5530; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }

.step { display: flex; gap: 14px; }

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--olive-deep);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.step-done .step-num { background: var(--ok); }
.step-done .step-num::before { content: '✓'; }
.step-done .step-num { font-size: 0; }
.step-done .step-num::before { font-size: 16px; }

.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin: 4px 0 8px; font-size: 17px; }

.amount-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.amount {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
}

.upload-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }

.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
  border: 2px dashed #cdbfa5;
  border-radius: 12px;
  background: #fbf8f2;
  text-align: center;
  cursor: pointer;
  color: var(--ink-soft);
}

.dropzone:hover, .dropzone.drag { border-color: var(--gold-deep); background: #fff; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); }

.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dz-text strong { color: var(--ink); font-size: 15px; }

.dz-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.save-link { margin: 18px 0 0; text-align: center; }

.done { text-align: center; padding: 10px 0; }
.done h2 { font-family: var(--serif); font-size: 30px; margin: 8px 0; }

.done-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foot {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(243, 236, 223, 0.5);
  margin-top: 28px;
}

@media (max-width: 640px) {
  .wrap { padding-top: 22px; }
  .invite-grid { grid-template-columns: 1fr; }
  .facts { flex-direction: row; }
  .fact { flex: 1; padding: 14px 16px; }
  .fact-price { font-size: 40px; }
  .panel { padding: 22px 18px; }
  .row-2 { grid-template-columns: 1fr; }
  .reg-head { flex-direction: column; }
}

@media (max-width: 400px) {
  .facts { flex-direction: column; }
}

@media (hover: none) {
  .hint-desktop { display: none; }
}

/* ---- v2: список ифтаров, оплата в форме ---- */
.brand-home { color: inherit; text-decoration: none; display: inline-block; }

.back-pub {
  display: inline-block;
  margin: -8px 0 14px;
  color: rgba(243, 236, 223, 0.75);
  font-size: 14px;
  text-decoration: none;
}
.back-pub:hover { color: var(--gold); }

.event-list { display: flex; flex-direction: column; gap: 14px; }

.event-card {
  display: flex;
  gap: 18px;
  align-items: stretch;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.event-card:hover { transform: translateY(-2px); box-shadow: 0 22px 56px rgba(0, 0, 0, 0.4); }

.ec-date {
  flex-shrink: 0;
  width: 78px;
  border-radius: 10px;
  background: var(--olive-deep);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
}
.ec-day { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1; }
.ec-month { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; margin-top: 4px; }

.ec-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ec-title { font-size: 18px; font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ec-mine { font-size: 11px; font-weight: 700; background: #dfe9d6; color: var(--ok); padding: 3px 10px; border-radius: 999px; }
.ec-menu { font-size: 14px; color: var(--ink-soft); }
.ec-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.ec-price { font-family: var(--serif); font-weight: 700; font-size: 26px; }
.ec-price small { font-family: var(--sans); font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.ec-go { font-weight: 700; color: var(--olive-deep); font-size: 15px; }
.ec-closed { font-weight: 700; color: var(--error); font-size: 14px; }

.pay-box {
  border: 1.5px solid #e0d6c3;
  border-radius: 12px;
  background: #fbf8f2;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pay-step { display: flex; gap: 12px; align-items: flex-start; }
.pay-step .step-num { width: 28px; height: 28px; font-size: 14px; }
.pay-step p { margin: 2px 0 0; }
.pay-box .btn-sbp { margin-top: 0; }
.pay-box .hint-desktop { margin: -4px 0 0; }
.pay-box .dropzone { background: #fff; }

.receipt-hint { margin-top: -4px; }
.receipt-hint[hidden] { display: none; }

.after-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  font-size: 14px;
}
.after-links a { color: var(--gold); text-decoration: none; }
.after-links a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .event-card { gap: 14px; padding: 14px; }
  .ec-date { width: 64px; }
  .ec-day { font-size: 32px; }
}

/* ---- v3: длинные заголовки («Женский ифтар») ---- */
.hero-title-long {
  font-size: clamp(42px, 11.5vw, 92px);
  line-height: 1;
  overflow-wrap: anywhere;
}
.ec-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: -2px;
}
