/* =====================================================
   FONT + THEME
===================================================== */
@font-face {
  font-family: "Post";
  src: url("/fonts/PostRegular.woff2") format("woff2"),
       url("/fonts/PostRegular.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #fff7ef;
  --text: #2f2f2f;
  --muted: #666;
  --btn: #2f2f2f;
  --btn-hover: #000;
  --radius: 12px;
  --shadow: 0 10px 24px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Post", system-ui, sans-serif;
  overflow-x: hidden;
  line-height: 1.45;
}

/* =====================================================
   IMAGE STACKS
===================================================== */
.image-stack {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-stack-desktop { display: flex; }
.image-stack-mobile { display: none; }

.invitation-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  filter: blur(12px);
  opacity: 0;
  transition: filter .8s ease, opacity .8s ease;
}

.invitation-image.loaded {
  filter: blur(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .image-stack-desktop { display: none; }
  .image-stack-mobile { display: flex; }
}

/* =====================================================
   BUTTONS
===================================================== */
.btn,
.logout-btn,
.contact-btn {
  font-family: "Post";
  font-size: 0.95rem;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
  letter-spacing: 0.3px;
}

.btn:hover,
.logout-btn:hover,
.contact-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

/* =====================================================
   UI CONTROLS (LOGOUT + CONTACT)
===================================================== */
.ui-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

.logout-btn,
.contact-btn {
  pointer-events: auto;
  position: fixed;
  z-index: 1200;
  background: rgba(47,47,47,0.92);
  backdrop-filter: blur(4px);
}

.logout-btn {
  top: calc(0.8rem + env(safe-area-inset-top));
  left: calc(0.8rem + env(safe-area-inset-left));
}

.contact-btn {
  bottom: calc(1rem + env(safe-area-inset-bottom));
  right: calc(1rem + env(safe-area-inset-right));
}

@media (max-width: 768px) {
  .logout-btn,
  .contact-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
  }
}

/* =====================================================
   CONTACT MODAL
===================================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.25s ease-in-out;
}

.modal-dialog {
  background: #fff;
  padding: 2rem 1.8rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 90%;
  position: relative;
  animation: popIn 0.25s ease-in-out;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.2rem;
}

.modal-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-grid label {
  font-family: "Post";
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.modal-grid input[type="text"],
.modal-grid textarea {
  width: 100%;
  font-family: "Post";
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  font-size: 1rem;
}

textarea {
  resize: none !important;
  min-height: 150px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #333;
}

.status {
  text-align: center;
  color: var(--muted);
  margin-top: 6px;
}

/* =====================================================
   LOGIN PAGE – WIDTH OPTION A2
===================================================== */
.login-wrapper {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.2rem;
}

.login-card {
  background: #fff;
  padding: 2.4rem 2rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.login-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-sub {
  color: var(--muted);
  margin-bottom: 1.8rem;
  font-size: 1.05rem;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.login-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Post";
  background: var(--btn);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.login-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

/* =====================================================
   SPINNER (GLOBAL)
===================================================== */
#spinnerOverlay {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 247, 239, 0.9) !important;
  backdrop-filter: blur(6px) !important;
  z-index: 999999 !important;
  pointer-events: all !important;
}

#spinnerOverlay.active {
  display: flex !important;
}

.spinner-ring {
  width: 55px;
  height: 55px;
  border: 6px solid #ccc;
  border-top-color: var(--btn);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.spinner-active {
  overflow: hidden !important;
}

/* Footer forced behind spinner */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* =====================================================
   ANIMATIONS
===================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* =============================================
   CHECKING PAGE LAYOUT (CENTRED)
   ============================================= */
.checking-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 2rem;
}

.checking-spinner {
  width: 70px;
  height: 70px;
  border: 8px solid #ddd;
  border-top-color: var(--btn);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 2rem;
}

.checking-title {
  font-size: 2rem;
  margin: 0.5rem 0;
  font-family: "Post";
}

.checking-text {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
