/* ==========================================================================
   STREAMLINED RSVP PORTAL - CLEAN MODERN & EXPANDED LAYOUT
   ========================================================================== */

:root {
  --bg-page: #0d0f14;
  --card-bg: #141720;
  --card-border: #232836;
  
  --primary-accent: #ffffff;
  --primary-button-bg: #f8fafc;
  --primary-button-text: #0f172a;
  
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle clean neutral background */
.background-ambient {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
    radial-gradient(circle at 50% 90%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Main Container & Card - Wider Layout */
.page-container {
  width: 100%;
  max-width: 920px;
  position: relative;
  z-index: 2;
  margin: auto;
}

.invitation-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 38px 42px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 32px;
  animation: cardFadeIn 0.5s ease-out;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. The Image: unnamed.jpg presentation */
.envelope-presentation {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background: #000000;
  transition: transform 0.3s ease;
}

.envelope-presentation:hover {
  transform: translateY(-2px);
}

.invitation-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* 2. Essential Information: Dress Code, Valet Services & Security */
.event-essentials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: #0f1219;
  border: 1px solid #1e2330;
  border-radius: var(--radius-md);
  padding: 20px 18px;
}

.essential-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 6px;
}

.essential-item:not(:last-child) {
  border-right: 1px solid #1e2330;
}

.essential-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.essential-icon svg {
  width: 20px;
  height: 20px;
}

.essential-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.essential-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.essential-value {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.35;
  font-weight: 500;
}

/* 3. Sign in with Google to Validate RSVP Button */
.rsvp-action-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#google-auth-initial {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.btn-google-rsvp {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: var(--radius-md);
  padding: 15px 28px;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.btn-google-rsvp:hover {
  background: #f8f9fa;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
  border-color: #4285f4;
}

.btn-google-rsvp:active {
  transform: translateY(0);
}

.google-g-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.google-g-icon svg {
  width: 22px;
  height: 22px;
}

.btn-google-text {
  letter-spacing: 0.01em;
}

.rsvp-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

/* Validated Panel (Appears after Google Sign In) */
.validated-panel {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.validated-user-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0f1219;
  border: 1px solid #10b981;
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.94rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-verified {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 8px;
  border-radius: 4px;
}

.badge-verified svg {
  width: 14px;
  height: 14px;
}

.btn-signout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s;
}

.btn-signout:hover {
  color: #ef4444;
}

/* Decision options (Accept / Decline) */
.decision-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.decision-card {
  cursor: pointer;
  position: relative;
}

.decision-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.decision-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: #0f1219;
  border: 1px solid #232836;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: #ffffff;
  transition: all 0.2s ease;
}

.decision-card input[type="radio"]:checked + .decision-content {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #ffffff;
}

.decision-card.decline input[type="radio"]:checked + .decision-content {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #fca5a5;
}

.btn-confirm-rsvp {
  width: 100%;
  background: var(--primary-button-bg);
  color: var(--primary-button-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-confirm-rsvp:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.mini-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Success / Confirmed State */
.success-screen {
  text-align: center;
  padding: 12px 0;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.success-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #10b981;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: #ffffff;
  margin-bottom: 6px;
}

.success-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.vip-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0f1219;
  border: 1px solid #232836;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.vip-code-pill strong {
  font-family: monospace;
  color: #ffffff;
  font-size: 1.02rem;
}

.btn-reset {
  display: block;
  margin: 18px auto 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.84rem;
  text-decoration: underline;
  cursor: pointer;
}

.btn-reset:hover {
  color: #ffffff;
}

/* Google Sign-in Modal */
.google-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.google-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.google-dialog {
  background: #ffffff;
  color: #202124;
  width: 100%;
  max-width: 400px;
  border-radius: 16px;
  padding: 34px 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

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

.g-header {
  margin-bottom: 16px;
}

.g-logo {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  display: block;
}

.g-header h3 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  color: #202124;
}

.g-header p {
  font-size: 0.84rem;
  color: #5f6368;
  margin-top: 4px;
}

.google-loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 16px;
}

/* Material 4-Color Google Spinner */
.google-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4285F4;
  border-right: 4px solid #EA4335;
  border-bottom: 4px solid #FBBC05;
  border-left: 4px solid #34A853;
  animation: googleSpin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

@keyframes googleSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.g-redirect-footer {
  margin-top: 14px;
  font-size: 0.86rem;
  color: #5f6368;
}

.g-redirect-footer strong {
  color: #202124;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .invitation-card {
    padding: 24px 20px;
    gap: 24px;
  }

  .event-essentials {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .essential-item:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid #1e2330;
    padding-bottom: 12px;
  }

  .btn-google-rsvp {
    font-size: 0.95rem;
    padding: 13px 18px;
  }
}
