:root {
  --home-hero-image: url("/assets/hero-camilla-marcos.png");
  --home-hero-size: cover;
  --home-hero-position: center center;
  --paper: #fbf7f2;
  --white: #fffdf9;
  --ink: #30302c;
  --muted: #6f6e66;
  --sage: #758563;
  --sage-dark: #59684d;
  --blush: #d9a18d;
  --line: #eadfd6;
  --shadow: 0 18px 40px rgba(56, 45, 34, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.1;
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  font-style: italic;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 82px;
  padding: 12px clamp(18px, 5vw, 64px);
  background: rgba(255, 253, 249, 0.96);
  border-bottom: 1px solid rgba(210, 198, 185, 0.55);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 92px;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.brand small {
  color: var(--blush);
  font-style: italic;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(14px, 2.5vw, 34px);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

nav a {
  text-decoration: none;
}

.nav-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: calc(100vh - 82px);
  display: grid;
  align-items: center;
  padding: 72px clamp(24px, 8vw, 110px);
  overflow: hidden;
  color: white;
  background-image: var(--home-hero-image);
  background-size: var(--home-hero-size);
  background-position: var(--home-hero-position);
  background-repeat: no-repeat;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26, 31, 21, 0.78), rgba(26, 31, 21, 0.34) 48%, rgba(26, 31, 21, 0.04));
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 650px;
  text-align: center;
}

.hero__content[data-align="left"] {
  justify-self: start;
  text-align: left;
}

.hero__content[data-align="right"] {
  justify-self: end;
  text-align: right;
}

.hero__content[data-align="center"] {
  justify-self: center;
  text-align: center;
}

.hero__content[data-font="sans"] h1,
.hero__content[data-font="sans"] .eyebrow,
.hero__content[data-font="sans"] .date,
.hero__content[data-font="sans"] p {
  font-family: "Segoe UI", Arial, sans-serif;
}

.hero__content[data-font="script"] h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.hero h1 {
  font-size: clamp(3.4rem, 8vw, 7.5rem);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.hero h1 span,
.heart {
  color: var(--blush);
  font-style: italic;
}

.eyebrow,
.date {
  margin: 16px 0;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px auto;
}

.divider span {
  width: 72px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.divider i::before {
  content: "♥";
  color: var(--blush);
  font-style: normal;
}

.leaf {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 170px;
  height: 250px;
  opacity: 0.68;
  background:
    radial-gradient(ellipse at 60% 20%, transparent 56%, rgba(255,255,255,.9) 57% 58%, transparent 59%) 0 0 / 80px 70px,
    linear-gradient(115deg, transparent 49%, rgba(255,255,255,.9) 50%, transparent 51%);
}

.section {
  position: relative;
  padding: clamp(56px, 8vw, 100px) clamp(22px, 6vw, 88px);
  text-align: center;
}

.section__copy {
  max-width: 560px;
  margin: 0 auto;
}

.section__copy p {
  color: var(--muted);
  font-size: 1.05rem;
}

.story {
  display: grid;
  grid-template-columns: minmax(150px, 240px) 1fr minmax(150px, 240px);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  background: var(--paper);
}

.photo {
  margin: 0;
  padding: 12px;
  background: white;
  box-shadow: var(--shadow);
}

.photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.photo--left {
  rotate: -5deg;
}

.photo--right {
  rotate: 5deg;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: linear-gradient(180deg, var(--sage), var(--sage-dark));
  box-shadow: 0 12px 24px rgba(89, 104, 77, 0.22);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.button--small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.72rem;
}

.button--danger {
  background: linear-gradient(180deg, #a84d3f, #743327);
  box-shadow: 0 10px 18px rgba(116, 51, 39, 0.18);
}

.button--secondary {
  color: var(--sage-dark);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-grid,
.gift-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: 980px;
  margin: 36px auto;
}

.day-grid article {
  padding: 24px 20px;
  border-right: 1px solid var(--line);
}

.day-photo-button {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
  cursor: zoom-in;
}

.day-photo-button[hidden],
.icon[hidden] {
  display: none !important;
}

.day-photo-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.day-map-link {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 0.72rem;
}

.day-grid article:last-child {
  border-right: 0;
}

.icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: var(--sage-dark);
  background: var(--paper);
  font-size: 2rem;
}

h3 {
  margin: 0 0 8px;
  color: var(--sage-dark);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section--tinted {
  background: #fbefeb;
}

.timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  max-width: 620px;
  margin: 26px auto 34px;
}

.timer div {
  border-right: 1px solid #d7c2b8;
}

.timer div:last-child {
  border-right: 0;
}

.timer strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 400;
  color: #743927;
}

.timer span {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-section {
  background: var(--white);
}

.panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 860px;
  margin: 34px auto 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: left;
}

label {
  display: grid;
  gap: 8px;
  color: var(--sage-dark);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d9ccc0;
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  font: inherit;
}

textarea {
  resize: vertical;
}

.wide,
.panel .button,
.status {
  grid-column: 1 / -1;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--sage-dark);
  font-weight: 700;
}

.gifts {
  background: var(--paper);
}

.gift-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gift-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: left;
}

.gift-photo-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.gift-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper);
}

.gift-card strong {
  display: block;
  color: #743927;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
  text-align: center;
}

.gift-card p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.gift-card__availability {
  display: block;
  margin-top: -4px;
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.gift-card.reserved {
  opacity: 0.64;
}

.gift-checkout-button {
  width: 100%;
}

.gift-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: none;
  place-items: center;
  padding: 18px;
}

.gift-photo-modal.is-open {
  display: grid;
}

.gift-photo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 35, 29, 0.58);
  backdrop-filter: blur(4px);
}

.gift-photo {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  padding: clamp(28px, 5vw, 42px);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(22, 24, 19, 0.35);
  text-align: center;
}

.gift-photo h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.gift-photo img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: var(--paper);
}

.rsvp-lookup {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--sage-dark);
  background: var(--paper);
  font-weight: 700;
}

.rsvp-companions {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.rsvp-companions > strong {
  color: var(--sage-dark);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rsvp-companion-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.65fr);
  gap: 12px;
  align-items: end;
}

.rsvp-child-option {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.rsvp-child-option input {
  width: auto;
}

body[data-layout="garden"] {
  --paper: #f3f7ef;
  --white: #fffefb;
  --ink: #293126;
  --muted: #68735f;
  --sage: #6f8c5c;
  --sage-dark: #466138;
  --blush: #c98f78;
  --line: #dfe9d8;
}

body[data-layout="garden"] .hero {
  background-position: var(--home-hero-position);
}

body[data-layout="garden"] .hero__overlay {
  background: linear-gradient(90deg, rgba(32, 47, 26, 0.82), rgba(63, 91, 47, 0.4) 56%, rgba(255, 255, 255, 0.08));
}

body[data-layout="garden"] .story {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.6), rgba(243,247,239,0.9)),
    var(--paper);
}

body[data-layout="editorial"] {
  --paper: #f7f5f0;
  --white: #ffffff;
  --ink: #20201e;
  --muted: #62615d;
  --sage: #20201e;
  --sage-dark: #20201e;
  --blush: #a86f63;
  --line: #ded8cf;
}

body[data-layout="editorial"] .hero {
  align-items: end;
  background-position: var(--home-hero-position);
}

body[data-layout="editorial"] .hero__overlay {
  background: linear-gradient(180deg, rgba(17, 17, 15, 0.08), rgba(17, 17, 15, 0.86));
}

body[data-layout="editorial"] .hero__content {
  max-width: 760px;
  text-align: left;
}

body[data-layout="editorial"] .hero .divider {
  margin-left: 0;
}

body[data-layout="editorial"] .story {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  text-align: left;
}

body[data-layout="editorial"] .story .section__copy {
  max-width: 760px;
}

body[data-layout="editorial"] .photo--right {
  display: none;
}

body[data-layout="sunset"] {
  --paper: #fff3ec;
  --white: #fffaf6;
  --ink: #34251f;
  --muted: #7a665d;
  --sage: #9b6d4c;
  --sage-dark: #6f4632;
  --blush: #d48b73;
  --line: #efd8cc;
}

body[data-layout="sunset"] .hero {
  background-position: var(--home-hero-position);
}

body[data-layout="sunset"] .hero__overlay {
  background: linear-gradient(90deg, rgba(80, 45, 29, 0.78), rgba(136, 83, 55, 0.44) 52%, rgba(255, 199, 158, 0.1));
}

body[data-layout="sunset"] .section--tinted {
  background: #fff0e7;
}

body[data-layout="minimal"] {
  --paper: #f6f6f3;
  --white: #ffffff;
  --ink: #2b2b29;
  --muted: #6d6d68;
  --sage: #6b7564;
  --sage-dark: #4f594a;
  --blush: #b78678;
  --line: #e1e1dc;
}

body[data-layout="minimal"] .hero {
  min-height: 680px;
  color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(255,255,255,0.94), rgba(255,255,255,0.74) 44%, rgba(255,255,255,0.18)),
    var(--home-hero-image);
  background-size: cover, var(--home-hero-size);
  background-position: center, var(--home-hero-position);
  background-repeat: no-repeat;
}

body[data-layout="minimal"] .hero__overlay,
body[data-layout="minimal"] .leaf {
  display: none;
}

body[data-layout="minimal"] .hero__content {
  text-align: inherit;
}

body[data-layout="minimal"] .hero .divider {
  margin-left: 0;
}

body[data-layout="minimal"] .photo {
  box-shadow: none;
  border: 1px solid var(--line);
}

.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 22px;
}

.checkout-modal.is-open {
  display: grid;
}

.checkout-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 35, 29, 0.64);
  backdrop-filter: blur(4px);
}

.checkout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(22, 24, 19, 0.35);
  text-align: left;
}

.checkout__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--sage-dark);
  background: rgba(255, 253, 249, 0.94);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.checkout__summary {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(28px, 5vw, 48px);
  color: white;
  background:
    linear-gradient(180deg, rgba(47, 58, 39, 0.86), rgba(47, 58, 39, 0.92)),
    url("/assets/hero-camilla-marcos.png") center / cover;
}

.checkout__summary h2 {
  color: white;
}

.checkout__summary .eyebrow {
  margin: 0;
}

.checkout-item,
.checkout-total,
.checkout-note {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.checkout-item span,
.checkout-total span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

.checkout-item strong,
.checkout-total strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 400;
}

.checkout-item p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.84);
}

.checkout__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: clamp(28px, 5vw, 48px);
  background: var(--paper);
}

.checkout__form .button,
.checkout__form .status,
.checkout__form .wide,
.checkout-note {
  grid-column: 1 / -1;
}

.card-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(117, 133, 99, 0.24);
  border-radius: 8px;
  background: var(--white);
}

.card-payment-fields[hidden] {
  display: none;
}

.checkout-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--sage-dark);
  background: var(--white);
}

.payment-result,
.pix-result {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid rgba(117, 133, 99, 0.28);
  border-radius: 8px;
  color: var(--sage-dark);
  background: #f4f8ef;
}

.payment-result[hidden],
.pix-result[hidden] {
  display: none;
}

.payment-result span,
.pix-result span,
.pix-result small {
  color: var(--muted);
}

.payment-result .button,
.pix-result .button {
  width: 100%;
}

.pix-result img {
  width: min(260px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 10px solid var(--white);
  border-radius: 8px;
  background: var(--white);
}

.pix-result textarea {
  min-height: 112px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 32px;
  color: var(--muted);
  background: var(--white);
}

.admin-page {
  background: var(--paper);
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(38, 47, 31, 0.78), rgba(38, 47, 31, 0.3)),
    url("/assets/hero-camilla-marcos.png") center / cover;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  padding: clamp(28px, 6vw, 48px);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 22px;
}

.login-card h1 {
  margin-bottom: 24px;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-style: italic;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form--spaced {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.album-hero {
  min-height: 420px;
  display: grid;
  align-items: center;
  padding: clamp(64px, 10vw, 120px) clamp(24px, 8vw, 110px);
  color: white;
  background:
    linear-gradient(90deg, rgba(37, 45, 31, 0.82), rgba(37, 45, 31, 0.32)),
    url("/assets/hero-camilla-marcos.png") center / cover;
}

.album-hero__content {
  max-width: 640px;
}

.album-hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-style: italic;
}

.album-hero p {
  max-width: 560px;
  font-size: 1.1rem;
}

.album-upload {
  background: var(--paper);
}

.album-panel {
  display: grid;
  gap: 18px;
  max-width: 860px;
  margin: 34px auto 0;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: left;
  box-shadow: var(--shadow);
}

.upload-drop {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 2px dashed #cdbdaf;
  border-radius: 8px;
  padding: 26px;
  text-align: center;
  cursor: pointer;
  background: #fffaf5;
}

.upload-drop span {
  color: var(--sage-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
}

.upload-drop small {
  color: var(--muted);
}

.upload-drop input {
  width: 1px;
  height: 1px;
  opacity: 0;
  padding: 0;
  border: 0;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.upload-preview article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.upload-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.upload-preview span {
  display: block;
  padding: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-section {
  background: var(--white);
}

.album-locked,
.album-unlocked {
  margin: 24px auto 0;
  text-align: center;
}

.album-logout-button {
  color: var(--sage-dark);
}

.album-grid {
  columns: 4 220px;
  column-gap: 18px;
  max-width: 1180px;
  margin: 34px auto 0;
  text-align: left;
}

.album-photo {
  break-inside: avoid;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.album-photo__button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.album-photo img {
  width: 100%;
  display: block;
}

.album-photo figcaption {
  padding: 12px 14px;
  color: var(--muted);
}

.empty-album {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 24px;
}

.photo-lightbox.is-open {
  display: grid;
}

.photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 27, 21, 0.78);
  backdrop-filter: blur(5px);
}

.photo-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.photo-lightbox figure {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.photo-lightbox img {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  display: block;
  background: #1f211c;
}

.photo-lightbox figcaption {
  min-height: 48px;
  padding: 14px 18px;
  color: var(--muted);
  background: var(--white);
  text-align: center;
}

.photo-lightbox__close,
.photo-lightbox__nav {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  color: var(--white);
  background: rgba(47, 58, 39, 0.82);
  cursor: pointer;
}

.photo-lightbox__close {
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
}

.photo-lightbox__nav {
  top: 50%;
  width: 52px;
  height: 52px;
  font-size: 2.5rem;
  transform: translateY(-50%);
}

.photo-lightbox__nav--prev {
  left: -20px;
}

.photo-lightbox__nav--next {
  right: -20px;
}

.admin-main {
  text-align: left;
}

.admin-main h1 {
  margin-bottom: 28px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 4px 14px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.admin-tab.is-active {
  border-color: var(--sage);
  color: var(--sage-dark);
}

.admin-block {
  margin: 28px 0;
  padding: 24px;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.admin-panel[hidden] {
  display: none;
}

.admin-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-filter {
  display: grid;
  gap: 4px;
  min-width: 190px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-block h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

.guest-list-grids {
  display: grid;
  gap: 24px;
}

.guest-list-group {
  display: grid;
  gap: 12px;
}

.guest-list-group h3 {
  margin: 0;
  color: var(--sage-dark);
  font-size: 1.25rem;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 22px;
}

.admin-modal.is-open {
  display: grid;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 35, 29, 0.64);
  backdrop-filter: blur(4px);
}

.admin-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  padding: clamp(26px, 5vw, 38px);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(22, 24, 19, 0.35);
}

.admin-modal__dialog--wide {
  width: min(980px, 100%);
}

.admin-modal__dialog--small {
  width: min(520px, 100%);
}

.admin-modal__dialog h2 {
  margin-bottom: 22px;
  font-size: 2rem;
}

.admin-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sage-dark);
  background: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.admin-gift-form,
.admin-guest-form,
.admin-expense-form,
.contact-import-form,
.site-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-gift-form .wide,
.admin-gift-form .button,
.admin-gift-form .status,
.admin-guest-form .wide,
.admin-guest-form .button,
.admin-guest-form .status,
.admin-expense-form .wide,
.admin-expense-form .button,
.admin-expense-form .status,
.contact-import-form .wide,
.contact-import-form .button,
.contact-import-form .status,
.site-settings-form .wide,
.site-settings-form .button,
.site-settings-form .status {
  grid-column: 1 / -1;
}

.admin-gift-form .button,
.admin-guest-form .button,
.admin-expense-form .button,
.contact-import-form .button,
.site-settings-form .button {
  justify-self: start;
}

.admin-user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-user-form .wide,
.admin-user-form .button,
.admin-user-form .status {
  grid-column: 1 / -1;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.permission-grid > strong {
  grid-column: 1 / -1;
  color: var(--sage-dark);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-option input {
  width: auto;
}

.guest-companions {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.guest-companions__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guest-companions__header strong {
  color: var(--sage-dark);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guest-companion-grid {
  display: grid;
  gap: 10px;
  max-height: min(340px, 44vh);
  overflow-y: auto;
  padding-right: 6px;
}

.guest-companion-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(110px, 0.45fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.guest-companion-child {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.guest-companion-child input {
  width: auto;
}

.contact-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-import-preview {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-import-preview table {
  min-width: 680px;
}

.contact-import-preview input[type="checkbox"] {
  width: auto;
}

.gift-image-picker {
  display: grid;
  gap: 10px;
}

.gift-image-picker > strong {
  color: var(--sage-dark);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gift-image-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.gift-image-picker__grid label {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.gift-image-picker__grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.expense-installments {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.expense-installments > strong {
  color: var(--sage-dark);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.expense-documents,
.installment-documents {
  display: grid;
  gap: 10px;
}

.expense-documents:empty,
.installment-documents:empty {
  display: none;
}

.expense-documents > strong,
.installment-documents > strong,
.expense-documents__header > strong,
.expense-documents__existing > strong,
.installment-documents__header > strong {
  color: var(--sage-dark);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.expense-documents__header,
.installment-documents__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.expense-document-grid,
.payment-document-grid {
  display: grid;
  gap: 10px;
}

.expense-document-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.expense-document-links {
  display: grid;
  gap: 6px;
}

.rsvp-companion-list {
  display: grid;
  gap: 4px;
}

.rsvp-companion-list span {
  color: var(--text);
}

.expense-document-links a {
  color: var(--sage-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.document-link-button {
  border: 0;
  padding: 0;
  color: var(--sage-dark);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.expense-document-links small {
  display: block;
  color: var(--muted);
}

.installment-documents {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.68);
}

.admin-empty-text {
  color: var(--muted);
  font-size: 0.86rem;
}

.document-viewer {
  display: grid;
  gap: 16px;
}

.document-viewer iframe {
  width: 100%;
  height: min(68vh, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

#expense-installment-fields {
  display: grid;
  gap: 12px;
  max-height: min(420px, 52vh);
  overflow-y: auto;
  padding-right: 6px;
}

.expense-installment-row {
  display: grid;
  grid-template-columns: 42px repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.expense-installment-row > span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 8px;
  color: var(--sage-dark);
  background: var(--white);
  font-weight: 700;
}

.payment-form {
  display: grid;
  gap: 16px;
}

.payment-form__subtitle {
  margin: -8px 0 0;
  color: var(--muted);
}

.payment-installment-grid {
  display: grid;
  gap: 10px;
  max-height: min(440px, 54vh);
  overflow-y: auto;
  padding-right: 6px;
}

.payment-installment-row {
  display: grid;
  grid-template-columns: 42px minmax(150px, 0.85fr) minmax(150px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.payment-installment-row > span {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-radius: 8px;
  color: var(--sage-dark);
  background: var(--white);
  font-weight: 700;
}

.payment-installment-row > small {
  min-height: 46px;
  display: grid;
  align-items: center;
  color: var(--muted);
}

.expense-row--paid {
  background: rgba(117, 133, 99, 0.1);
}

.expense-row--paid td:first-child {
  border-left: 4px solid var(--sage);
}

.expense-paid-badge {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--sage-dark);
  background: rgba(117, 133, 99, 0.18);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reservation-status {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reservation-status--pending {
  color: #7a5318;
  background: rgba(190, 141, 50, 0.18);
}

.reservation-status--confirmed {
  color: var(--sage-dark);
  background: rgba(117, 133, 99, 0.18);
}

.layout-form {
  display: grid;
  gap: 18px;
}

.layout-form > p {
  margin: 0;
  color: var(--muted);
}

.layout-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.layout-option {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

.layout-option:has(input:checked) {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(117, 133, 99, 0.18);
}

.layout-option input {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
}

.layout-option__preview {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 8px;
  min-height: 92px;
  padding: 10px;
  border-radius: 8px;
  background: #fbf7f2;
}

.layout-option__preview i,
.layout-option__preview b,
.layout-option__preview small {
  display: block;
  border-radius: 6px;
}

.layout-option__preview i {
  grid-row: span 2;
  background: #758563;
}

.layout-option__preview b {
  background: #d9a18d;
}

.layout-option__preview small {
  background: #fffdf9;
}

.layout-option__content {
  display: grid;
  gap: 4px;
  padding-right: 24px;
}

.layout-option__content strong {
  color: var(--sage-dark);
}

.layout-option__content small {
  color: var(--muted);
  line-height: 1.4;
}

.layout-option--garden .layout-option__preview {
  background: #f3f7ef;
}

.layout-option--garden .layout-option__preview i {
  background: #6f8c5c;
}

.layout-option--garden .layout-option__preview b {
  background: #c98f78;
}

.layout-option--editorial .layout-option__preview {
  background: #f7f5f0;
}

.layout-option--editorial .layout-option__preview i {
  background: #20201e;
}

.layout-option--editorial .layout-option__preview b {
  background: #a86f63;
}

.layout-option--sunset .layout-option__preview {
  background: #fff3ec;
}

.layout-option--sunset .layout-option__preview i {
  background: #9b6d4c;
}

.layout-option--sunset .layout-option__preview b {
  background: #d48b73;
}

.layout-option--minimal .layout-option__preview {
  background: #ffffff;
}

.layout-option--minimal .layout-option__preview i {
  background: #e1e1dc;
}

.layout-option--minimal .layout-option__preview b {
  background: #6b7564;
}

.admin-gift-thumb {
  width: 76px;
  height: 58px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper);
}

.admin-gift-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--sage-dark);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tfoot td {
  border-bottom: 0;
  background: var(--paper);
}

.expense-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.expense-summary div {
  display: grid;
  gap: 4px;
}

.expense-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.expense-summary strong {
  color: var(--sage-dark);
  font-size: 1.05rem;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 720px;
    background-position: 62% center;
  }

  .hero__overlay {
    background: linear-gradient(180deg, rgba(26, 31, 21, 0.76), rgba(26, 31, 21, 0.38));
  }

  .story,
  .day-grid,
  .gift-grid,
  .panel,
  .timer,
  .checkout,
  .checkout__form,
  .card-payment-fields,
  .rsvp-companion-row {
    grid-template-columns: 1fr;
  }

  .admin-gift-form,
  .admin-guest-form,
  .admin-expense-form,
  .contact-import-form,
  .site-settings-form,
  .admin-user-form,
  .guest-companion-row,
  .expense-installment-row,
  .payment-installment-row,
  .expense-document-row {
    grid-template-columns: 1fr;
  }

  .admin-block__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .checkout {
    max-height: calc(100vh - 24px);
  }

  .checkout-modal {
    padding: 12px;
  }

  .photo-lightbox {
    padding: 12px;
  }

  .photo-lightbox__close {
    top: 8px;
    right: 8px;
  }

  .photo-lightbox__nav--prev {
    left: 8px;
  }

  .photo-lightbox__nav--next {
    right: 8px;
  }

  .photo {
    max-width: 250px;
    margin: 0 auto;
  }

  .day-grid article,
  .timer div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .day-grid article:last-child,
  .timer div:last-child {
    border-bottom: 0;
  }
}

@media print {
  body.admin-page {
    background: white;
  }

  body.admin-page .topbar,
  body.admin-page .admin-tabs,
  body.admin-page .admin-block__actions,
  body.admin-page .admin-modal,
  body.admin-page .admin-panel {
    display: none !important;
  }

  body.admin-page .admin-main,
  body.admin-page .section {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.admin-page[data-print-target="guests"] #lista-convidados,
  body.admin-page[data-print-target="rsvps"] #confirmacoes,
  body.admin-page[data-print-target="expenses"] #gastos-financeiros {
    display: block !important;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  body.admin-page[data-print-target="guests"] #lista-convidados h2,
  body.admin-page[data-print-target="rsvps"] #confirmacoes h2,
  body.admin-page[data-print-target="expenses"] #gastos-financeiros h2 {
    margin-bottom: 18px;
    font-size: 24px;
  }

  body.admin-page[data-print-target="guests"] #lista-convidados thead th:last-child,
  body.admin-page[data-print-target="guests"] #lista-convidados tbody td:last-child,
  body.admin-page[data-print-target="rsvps"] #confirmacoes thead th:last-child,
  body.admin-page[data-print-target="rsvps"] #confirmacoes tbody td:last-child,
  body.admin-page[data-print-target="expenses"] #gastos-financeiros thead th:last-child,
  body.admin-page[data-print-target="expenses"] #gastos-financeiros tbody td:last-child {
    display: none !important;
  }

  body.admin-page .guest-list-grids {
    gap: 18px;
  }

  body.admin-page .table-wrap {
    overflow: visible;
    width: 100%;
  }

  body.admin-page table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
    font-size: 11px;
  }

  body.admin-page th,
  body.admin-page td {
    padding: 7px;
  }

  body.admin-page .expense-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  body.admin-page .expense-summary div {
    border: 1px solid #d8d8d8;
    padding: 8px;
  }
}
