/* ----- Foundations ----- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  display: inline-flex;
  gap: 4px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  padding: 6px 8px;
  border-radius: 999px;
  z-index: 50;
  font-size: 12px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.lang-link {
  text-decoration: none;
  color: var(--color-text);
  opacity: 0.5;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.lang-link.active { opacity: 1; background: var(--color-primary); color: #fff; }

/* ----- Guest card ----- */
body.guest {
  display: flex;
  justify-content: center;
  padding: 32px 16px 80px;
}

.card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 24px;
  padding: 0 32px 44px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
  overflow: hidden;
}

.hero { text-align: center; }

/* Hero photo: full card width, edge-to-edge at the top */
.hero-photo {
  margin: 0 -32px 28px;
  height: 340px;
  background: var(--color-bg);
  overflow: hidden;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* When there is no photo, give the card normal top padding */
.hero:not(:has(.hero-photo)) { padding-top: 44px; }

.couple {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive, serif;
  font-weight: 400;
  font-size: clamp(44px, 12vw, 78px);
  line-height: 1;
  margin: 0 0 14px;
  color: var(--color-accent);
  letter-spacing: 0.005em;
}
.date {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 4.5vw, 26px);
  margin: 0 0 18px;
  color: var(--color-primary);
  letter-spacing: 0.04em;
}
.intro {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 auto 22px;
  color: var(--color-text);
  opacity: 0.85;
  max-width: 440px;
}
.ornament {
  color: var(--color-primary);
  font-size: 22px;
  margin: 8px 0 24px;
  opacity: 0.6;
}

/* Form */
.field { display: flex; flex-direction: column; margin-bottom: 20px; }
.label {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--color-accent);
  font-weight: 600;
}

input[type=text], input[type=password], input[type=number], input[type=email], textarea, select {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(0,0,0,0.14);
  background: #ffffff;
  color: #2b2b2b;
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder {
  color: rgba(0,0,0,0.42);
  opacity: 1;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
textarea { resize: vertical; min-height: 110px; }
.hint { font-size: 12px; color: rgba(0,0,0,0.55); margin-top: 6px; }

.dropzone {
  display: block;
  border: 2px dashed color-mix(in srgb, var(--color-primary) 45%, #cccccc);
  border-radius: 16px;
  padding: 26px;
  text-align: center;
  cursor: pointer;
  background: #fafaf7;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone.drag { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, white); }
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--color-accent); }
.dropzone-text { font-size: 14px; font-weight: 500; }

.file-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.file-item {
  display: flex; flex-direction: column; align-items: center;
  background: #f7f4ec; padding: 6px; border-radius: 10px;
  width: 92px;
}
.file-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; }
.file-video {
  width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--color-primary) 18%, white); border-radius: 6px; font-size: 28px;
}
.file-name { font-size: 11px; margin-top: 4px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff; border: 0;
  padding: 14px 28px; border-radius: 999px; font-size: 16px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: transform 0.1s, filter 0.1s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.btn:hover { filter: brightness(0.95); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--color-accent); border: 1.5px solid var(--color-accent); }

/* Alerts */
.alert {
  padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px;
}
.alert.error { background: #fdecea; color: #8a2222; }
.alert.ok { background: #e8f5ec; color: #1f6b3a; }

/* Thanks */
body.thanks .card { text-align: center; padding: 56px 32px; }
.thanks-mark { font-size: 56px; color: var(--color-primary); margin-bottom: 14px; }
.signature {
  margin-top: 28px;
  font-family: 'Great Vibes', 'Cormorant Garamond', serif;
  color: var(--color-accent);
  font-size: 36px;
  line-height: 1.1;
}

/* ----- Slideshow ----- */
body.slideshow {
  font-family: 'Inter', sans-serif;
}
.stage {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
}
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1.2s ease;
}
.slide.visible { opacity: 1; transform: scale(1); }
.slide.leaving { opacity: 0; transform: scale(0.99); }

.slide-media {
  flex: 1.2;
  position: relative;
  background: color-mix(in srgb, var(--color-accent) 12%, white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slide-media img, .slide-media video {
  width: 100%; height: 100%; object-fit: cover;
}
.slide-media.no-media {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-primary) 30%, white),
    color-mix(in srgb, var(--color-accent) 30%, white));
}

.slide-thumbs {
  position: absolute;
  bottom: 20px; left: 20px;
  display: flex; gap: 8px;
}
.slide-thumbs img, .slide-thumbs .thumb-video {
  width: 70px; height: 70px; object-fit: cover; border-radius: 8px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.thumb-video {
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: color-mix(in srgb, var(--color-primary) 30%, white);
}

.slide-text {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 5vh 5vw 6vh;
  background: var(--color-bg);
  text-align: center;
}

/* Brand block (couple names + date) pinned to the TOP of the right panel */
.slide-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Message + signature take the remaining space and centre themselves vertically */
.slide-msg-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: clamp(20px, 4vh, 60px) 0;
}
.slide-brand .brand-name {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive, serif;
  font-weight: 400;
  font-size: clamp(48px, 5vw, 84px);
  line-height: 1;
  color: var(--color-accent);
  letter-spacing: 0.005em;
}
.slide-brand .brand-date {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 26px);
  color: var(--color-primary);
  letter-spacing: 0.08em;
}

.slide-msg {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(26px, 3.6vw, 56px);
  line-height: 1.25;
  margin: 0 0 28px;
  color: var(--color-accent);
  position: relative;
  max-width: 90%;
}
.slide-msg::before {
  content: '\201C';
  position: absolute;
  top: -0.4em; left: -0.3em;
  font-size: 2em;
  color: var(--color-primary);
  opacity: 0.3;
}
.slide-sig {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(18px, 1.8vw, 28px);
  color: var(--color-primary);
}
.slide-sig .name { font-style: italic; }
.slide-sig .dash { margin-right: 10px; }

@media (max-width: 900px) {
  .slide { flex-direction: column; }
  .slide-media { flex: 1; }
  .slide-text { flex: 1; padding: 18px 16px 24px; }
  .slide-brand .brand-name { font-size: 44px; }
  .slide-brand .brand-date { font-size: 16px; }
  .slide-msg-block { padding: 14px 0; }
  .slide-msg { font-size: 22px; margin-bottom: 18px; }
  .slide-sig { font-size: 16px; }
}

.waiting {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  color: var(--color-accent);
  text-align: center;
  padding: 24px;
}
.waiting.hidden { display: none; }
.waiting-brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 32px;
}
.waiting-brand .brand-name {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive, serif;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 1;
  color: var(--color-accent);
}
.waiting-brand .brand-date {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(20px, 1.8vw, 28px);
  color: var(--color-primary);
  letter-spacing: 0.08em;
}
.waiting-text {
  font-style: italic;
  font-size: 26px;
  color: var(--color-primary);
  opacity: 0.8;
}

/* ----- Misc ----- */
.btn-link {
  background: none; border: 0; color: var(--color-accent);
  cursor: pointer; font-size: 14px; padding: 6px 8px; border-radius: 6px;
  font-family: inherit;
}
.btn-link:hover { background: rgba(0,0,0,0.04); }
.btn-link.danger { color: #b3261e; }
.muted { color: rgba(0,0,0,0.5); font-weight: 400; font-size: 14px; }

/* ----- Mobile tweaks ----- */
@media (max-width: 480px) {
  body.guest { padding: 16px 12px 60px; }
  .card { padding: 0 20px 36px; border-radius: 20px; }
  .hero-photo { margin: 0 -20px 22px; height: 280px; }
  .couple { font-size: 46px; line-height: 1.05; }
  .date { font-size: 20px; margin-bottom: 14px; }
  .intro { font-size: 16px; line-height: 1.6; margin-bottom: 18px; }
  .ornament { margin: 4px 0 16px; }
  .label { font-size: 12px; }
  input[type=text], input[type=password], input[type=number], input[type=email], textarea, select {
    font-size: 16px; padding: 12px 14px; /* 16px to prevent iOS zoom */
  }
  .btn { padding: 13px 22px; font-size: 15px; width: 100%; }
  body.thanks .card { padding: 44px 22px; }
  .signature { font-size: 30px; }
  .lang-switch { top: 10px; right: 10px; }
}
