/* ============================================================
   Premiere Cinematic — Video Invite Template
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:              #080808;
  --surface:         #141414;
  --surface-raised:  #1e1e1e;
  --border:          rgba(255, 255, 255, 0.08);
  --text-primary:    #f5f0eb;
  --text-secondary:  rgba(245, 240, 235, 0.55);
  --accent:          #c9a96e;
  --accent-hover:    #d4b87e;
  --accent-muted:    rgba(201, 169, 110, 0.12);
  --radius-sm:   8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  26px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Page Layout
   ============================================================ */

.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  /* spatiu pentru bara fixa de jos */
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

/* ============================================================
   Video Container
   ============================================================ */

.video-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  height: 100vh;
  flex-shrink: 0;
  overflow: hidden;
  background: #050505;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dejacast-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.dejacast-player,
.video-container .dejacast-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.video-container.has-dejacast-player .dejacast-embed,
.video-container.has-dejacast-player .dejacast-embed .video-js,
.video-container.has-dejacast-player .dejacast-embed .video-js .vjs-tech,
.video-container.has-dejacast-player .dejacast-embed .video-js video,
.video-container.has-dejacast-player .dejacast-embed .video-js .vjs-poster {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
}

.video-container.has-dejacast-player .dejacast-embed .video-js .vjs-tech,
.video-container.has-dejacast-player .dejacast-embed .video-js video {
  object-fit: cover !important;
}

.video-container.has-dejacast-player .dejacast-embed .video-js .vjs-poster {
  background-size: cover !important;
}

/* ============================================================
   Top Overlay — Names + Date
   ============================================================ */

.overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 52px 24px 96px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.2) 60%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
  text-align: center;
}

.couple-names {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 7.5vw, 2.8rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.name {
  font-style: italic;
}

.ampersand {
  font-style: normal;
  font-weight: 400;
  font-size: 0.75em;
  color: var(--accent);
}

.event-date {
  margin-top: 7px;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   Start Overlay — Big Play
   ============================================================ */

.overlay-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.play-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.04em;
}

.overlay-start.fade-out {
  opacity: 0;
  pointer-events: none;
}

.play-btn-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button {
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-button svg {
  width: 38px;
  height: 38px;
  margin-left: 3px; /* optical centering of the triangle */
}

.play-button:hover,
.play-button:focus-visible {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.play-button:active {
  transform: scale(0.96);
}

/* ============================================================
   Sound Overlay — Tap to Unmute
   ============================================================ */

.overlay-sound {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding-top: 148px;
  z-index: 8;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay-sound.visible {
  opacity: 1;
  pointer-events: all;
}

.sound-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sound-pill:hover {
  background: rgba(0, 0, 0, 0.78);
}

/* ============================================================
   End-screen Overlay
   ============================================================ */

.overlay-end {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.overlay-end.visible {
  opacity: 1;
  pointer-events: all;
}

.end-content {
  text-align: center;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.end-names {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 6.5vw, 2.4rem);
  font-weight: 300;
  font-style: italic;
  color: #fff;
  letter-spacing: 0.02em;
}

.end-date {
  font-size: 0.71rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
}

.end-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 272px;
  margin-top: 12px;
}

.btn-end-primary {
  width: 100%;
  padding: 15px 20px;
  background: var(--accent);
  color: #1a1208;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.btn-end-primary:hover  { background: var(--accent-hover); }
.btn-end-primary:active { transform: scale(0.97); }

.btn-end-secondary {
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.btn-end-secondary:hover  { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.55); }
.btn-end-secondary:active { transform: scale(0.97); }

.btn-replay {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 100px;
  transition: color 0.2s ease;
}

.btn-replay:hover { color: rgba(255, 255, 255, 0.78); }

/* ============================================================
   Bottom Action Bar
   ============================================================ */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn-secondary:hover  { background: #282828; }
.btn-secondary:active { transform: scale(0.97); }

.btn-primary {
  flex: 1.45;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  background: var(--accent);
  color: #1a1208;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn-primary:hover  { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }

/* ============================================================
   Backdrop
   ============================================================ */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   Drawers — Bottom Sheets
   ============================================================ */

.drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 40;
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92dvh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(-50%) translateY(0);
}

.drawer-handle {
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  margin: 14px auto 0;
  flex-shrink: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.drawer-close:hover         { background: #2a2a2a; color: var(--text-primary); }
.drawer-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.drawer-body {
  padding: 6px 20px;
  padding-bottom: calc(24px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   When & Where — Event Blocks
   ============================================================ */

.event-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
}

.event-block-icon {
  width: 42px;
  height: 42px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.event-block-info {
  flex: 1;
  min-width: 0;
}

.event-block-label {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.event-block-location {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.event-block-datetime {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}

.event-block-address {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.btn-maps {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-maps:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: #282828;
}

.event-divider {
  height: 1px;
  background: var(--border);
}

/* ============================================================
   RSVP Form
   ============================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 9px;
}

.optional {
  text-transform: none;
  font-size: 0.74rem;
  letter-spacing: 0;
  font-weight: 400;
}

.radio-pills {
  display: flex;
  gap: 8px;
}

.radio-pill {
  flex: 1;
  cursor: pointer;
}

.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.radio-pill input[type="radio"]:checked + span {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

.radio-pill input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.number-stepper {
  display: flex;
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stepper-btn {
  width: 50px;
  height: 50px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
}

.stepper-btn:hover  { background: rgba(255, 255, 255, 0.06); }
.stepper-btn:active { background: rgba(255, 255, 255, 0.11); }

.number-stepper input[type="number"] {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 0;
  outline: none;
  -moz-appearance: textfield;
}

.number-stepper input[type="number"]::-webkit-inner-spin-button,
.number-stepper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: rgba(245, 240, 235, 0.28);
}

.form-input:focus {
  border-color: rgba(201, 169, 110, 0.5);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.rsvp-deadline {
  font-size: 0.74rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #1a1208;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}

.btn-submit:hover  { background: var(--accent-hover); }
.btn-submit:active { transform: scale(0.98); }

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: rgba(18, 32, 14, 0.96);
  border: 1px solid rgba(100, 210, 70, 0.28);
  color: #8ce87a;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 100px;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Utility
   ============================================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-group.hidden {
  display: none;
}

/* ============================================================
   Desktop — center & frame
   ============================================================ */

@media (min-width: 481px) {
  body {
    display: flex;
    justify-content: center;
    background: #030303;
  }

  .page-wrapper {
    width: 100%;
    max-width: 480px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.7);
  }
}
