.invite-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 1.5rem;
  background: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.invite-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.invite-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.invite-body {
  padding: 1.5rem;
  text-align: center;
}

.invite-label {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invite-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
}

.invite-dates {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  color: #444;
}

.invite-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.15s;
}

.invite-cta:hover {
  background: #333;
}

/* ================= Browser capture flow (non-iOS) ================= */

:root {
  --gc-pink: #F01A80;
  --gc-purple: #8F33F0;
  --gc-blue: #3373F5;
}

/* Use the brand gradient for the primary CTA on the capture flow. */
.invite-body[data-controller="invite-capture"] .invite-cta {
  background: linear-gradient(135deg, var(--gc-pink), var(--gc-purple));
}

.invite-body[data-controller="invite-capture"] .invite-cta:hover {
  background: linear-gradient(135deg, var(--gc-purple), var(--gc-blue));
}

.invite-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.invite-inactive {
  margin: 0.5rem 0 0;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  background: #faf0f6;
  color: var(--gc-pink);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* --- Name form --- */
.invite-name-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1rem;
}

.invite-name-label {
  font-size: 0.8125rem;
  color: #666;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invite-name-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid #d9d9d9;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #111;
  box-sizing: border-box;
}

.invite-name-input:focus {
  outline: none;
  border-color: var(--gc-purple);
  box-shadow: 0 0 0 3px rgba(143, 51, 240, 0.15);
}

/* --- Errors --- */
.invite-error {
  margin: 0;
  color: var(--gc-pink);
  font-size: 0.875rem;
  font-weight: 600;
}

/* --- Camera / capture --- */
.invite-remaining {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gc-purple);
}

.invite-camera-frame {
  position: relative; /* positioning context for the camera controls */
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4; /* fixed portrait viewport, like the native camera preview */
  max-height: 70vh;
  display: flex;
}

/* --- Camera controls (flash / flip) --- */
.invite-camera-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.invite-camera-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 0.1s, background 0.15s;
}

.invite-camera-button:active {
  transform: scale(0.92);
}

/* Flash engaged. */
.invite-camera-button.is-on {
  background: #fff;
  color: var(--gc-purple);
}

.invite-video {
  width: 100%;
  height: 100%;
  /* cover: fill the viewport, cropping to fit — matches the native apps' fill
     preview. The capture still encodes the full frame, not this cropped view. */
  object-fit: cover;
  display: block;
}

/* Front camera: mirror the preview only (the saved photo stays unmirrored,
   matching the default behavior of the iOS and Android camera apps). */
.invite-video.is-mirrored {
  transform: scaleX(-1);
}

.invite-canvas {
  display: none;
}

/* --- Shutter button --- */
.invite-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gc-pink), var(--gc-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.invite-shutter:active {
  transform: scale(0.92);
}

.invite-shutter:disabled {
  opacity: 0.5;
  cursor: default;
}

.invite-shutter-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
}

/* --- File fallback --- */
.invite-file-fallback {
  width: 100%;
  display: flex;
  justify-content: center;
}

.invite-file-label {
  cursor: pointer;
}

/* --- Status / progress --- */
.invite-status {
  margin: 0;
  font-size: 0.875rem;
  color: #444;
}

/* Upload progress bar (fed by ActiveStorage DirectUpload progress events). */
.invite-progress {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 0.5rem 0 0;
  border: none;
  border-radius: 3px;
  overflow: hidden;
  background: #eee;
}
.invite-progress::-webkit-progress-bar {
  background: #eee;
}
.invite-progress::-webkit-progress-value {
  background: linear-gradient(135deg, var(--gc-pink), var(--gc-purple));
  transition: width 0.15s ease;
}
.invite-progress::-moz-progress-bar {
  background: linear-gradient(135deg, var(--gc-pink), var(--gc-purple));
}

.invite-done {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gc-purple);
}

/* --- Persistent "Get the app" banner --- */
.invite-app-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--gc-pink), var(--gc-purple));
  color: #fff;
  font-size: 0.9375rem;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
}

.invite-app-banner-text {
  font-weight: 600;
}

.invite-app-banner-links {
  display: flex;
  gap: 0.5rem;
}

.invite-app-banner-link {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--gc-purple);
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.invite-app-banner-link:hover {
  background: #fff;
}

/* Keep content clear of the fixed bottom banner. */
.invite-page:has(.invite-app-banner) {
  padding-bottom: 5.5rem;
}
