/* 
  Waitlist Portal Styles (wp-)
  Provides robust, premium styling for the React island 
  without relying on Tailwind CSS.
*/

:root {
  --wp-glass-bg: rgba(23, 23, 23, 0.7);
  --wp-border: rgba(255, 255, 255, 0.12);
  --wp-glow: rgba(255, 255, 255, 0.05);
}

/* Overlay & Layout */
.wp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 20px;
}

.wp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wp-card-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  z-index: 1;
}

.wp-card {
  position: relative;
  background: var(--wp-glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--wp-border);
  border-radius: 32px;
  padding: 40px;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* Typography */
.wp-title {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-style: italic;
  color: #FFFFFF;
  margin-bottom: 12px;
  text-align: center;
}

.wp-description {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  text-align: center;
  max-width: 300px;
  margin: 0 auto 32px auto;
}

.wp-label {
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

/* OS Selector */
.wp-os-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 24px;
}

.wp-os-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wp-os-btn.selected {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Inputs */
.wp-input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent; /* Borderless when unselected */
  border-radius: 16px;
  padding: 0 16px;
  color: #FFFFFF;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  margin-bottom: 24px;
}

.wp-input:focus {
  border-color: rgba(255, 255, 255, 0.3); /* Colored border when selected */
  background: rgba(255, 255, 255, 0.08);
}

/* Primary Button */
.wp-btn-primary {
  width: 100%;
  height: 56px;
  background: #FFFFFF;
  color: #000000;
  border: none;
  border-radius: 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.v-checkbox-group {
  margin-top: 4px;
  margin-bottom: 4px;
}

.v-checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.v-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.v-checkbox-checkmark {
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  position: relative;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.v-checkbox-container:hover .v-checkbox-checkmark {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.v-checkbox-container input:checked ~ .v-checkbox-checkmark {
  background: var(--m3-primary);
  border-color: var(--m3-primary);
}

.v-checkbox-checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.v-checkbox-container input:checked ~ .v-checkbox-checkmark:after {
  display: block;
}

.v-checkbox-text {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.v-checkbox-container:hover .v-checkbox-text {
  color: rgba(255, 255, 255, 1);
}

.v-submit-btn {
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.wp-btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.waitlist-portal-overlay[data-state="open"] {
  opacity: 1;
  pointer-events: none;
}

.wp-portal-layer {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: screen;
}

.wp-w-full { width: 100% !important; }
.wp-px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.wp-relative { position: relative !important; }
.wp-absolute { position: absolute !important; }
.wp-inset-0 { top: 0; left: 0; right: 0; bottom: 0; }

.wp-btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Success State */
.wp-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

/* Checkbox */
.wp-checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 32px;
}

.wp-checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.wp-checkbox-box.checked {
  background: #FFFFFF;
  border-color: #FFFFFF;
}

.wp-checkbox-text {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

/* Close Button */
.wp-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 50%;
}

.wp-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Timer */
.wp-timer-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 32px;
}

.wp-timer-item {
  text-align: center;
}

.wp-timer-value {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: white;
}

.wp-timer-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
}

/* Scroll lock when waitlist dialog is open */
body.waitlist-open {
  overflow: hidden !important;
  touch-action: none !important;
  height: 100vh !important;
}

html:has(body.waitlist-open) {
  overflow: hidden !important;
}

/* Vanilla Waitlist Architecture Styles */
.v-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.v-modal-overlay.v-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.v-modal-card {
  position: fixed;
  top: calc(50% - 15px); /* Shifted 122px down total + 5px up adjustment */
  left: calc(50% + 270px);
  transform: translate(-50%, -40%) scale(0.95);
  width: 100%;
  max-width: 440px;
  background: rgba(20, 20, 22, 0.65);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: none;
  border-radius: 32px;
  padding: 40px;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.6);
  color: white;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
              top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sync Reveal & Celebration States */
.v-modal-card.v-reveal-active {
  top: calc(50% - 15px); /* Match welcome-back default position */
}

.v-modal-card.v-reveal-active .v-title {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease 0.1s;
}

.v-state-celebrating .v-modal-card.v-reveal-active .v-title {
  opacity: 1;
  transform: translateY(0);
}



/* Celebratory Sparkle Burst */
.v-sparkle-container {
  position: absolute;
  inset: -50px;
  pointer-events: none;
  z-index: -1;
  overflow: visible;
}

.v-sparkle {
  position: absolute;
  background: var(--m3-primary);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0;
}

@keyframes v-sparkle-spread {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.5); opacity: 0; }
}

@keyframes v-sparkle-drift {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  100% { transform: translate(var(--dx), var(--dy-drift)) scale(0.8); opacity: 0; }
}

/* Compass Pulse (Background) */
@keyframes v-compass-ring {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; border-width: 4px; }
  20% { opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; border-width: 1px; }
}

.v-pulse-active #hero-compass-pulse {
  animation: v-compass-ring 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.v-modal-overlay.v-open .v-modal-card {
  transform: translate(-50%, -50%) scale(1);
}

.v-title {
  font-family: 'Manrope', sans-serif !important;
  font-weight: 800;
  font-size: 32px;
  margin-bottom: 8px;
  text-align: center;
}

.v-modal-subtitle {
  font-family: 'Manrope', sans-serif !important;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  max-width: 320px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.v-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.v-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
  margin-left: 4px;
}

.v-input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0 16px;
  color: white;
  outline: none;
  transition: all 0.3s;
}

.v-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--m3-primary);
  outline: none !important;
}

.v-os-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.v-os-pill {
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 10px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.v-os-pill.active {
  background: var(--m3-primary);
  color: var(--m3-on-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.v-submit-btn {
  background: var(--m3-primary);
  color: var(--m3-on-primary);
  border: none;
  height: 48px;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
  margin-top: 8px;
}

.v-submit-btn:active {
  transform: scale(0.98);
}

.hidden { display: none; }

.v-success {
  text-align: center;
  padding: 20px 0;
}

/* Referral Dashboard */
.v-dashboard-title {
  color: var(--m3-primary) !important;
  font-size: 28px !important;
  margin-bottom: 4px !important;
  background: none !important;
  -webkit-text-fill-color: var(--m3-primary) !important;
}

.v-position-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 16px 0;
}

.v-position-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.light-mode .v-position-label {
  color: rgba(0, 0, 0, 0.4);
}

.v-position-number {
  font-family: 'Manrope', sans-serif;
  font-size: 56px;
  font-weight: 800;
  color: var(--m3-primary);
  line-height: 1;
  letter-spacing: -2px;
}

.v-referral-cta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin: 12px 0 16px;
}

.light-mode .v-referral-cta {
  color: rgba(0, 0, 0, 0.5);
}

.v-referral-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.v-referral-input {
  flex: 1;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0 12px;
  color: white;
  font-family: monospace;
  font-size: 12px;
  outline: none;
}

.light-mode .v-referral-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1c;
}

.v-copy-btn {
  height: 40px;
  padding: 0 16px;
  background: var(--m3-primary);
  color: var(--m3-on-primary);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.v-copy-btn:active {
  transform: scale(0.95);
}

.v-share-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  justify-content: center;
}

.v-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 24px;
  border: none;
  border-radius: 6px;
  font-size: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
  color: white;
}

.v-share-btn:hover {
  opacity: 0.75;
}

.v-share-btn:active {
  transform: scale(0.95);
}

.v-share-twitter {
  background: #000000;
}

.v-share-whatsapp {
  background: #25D366;
}

.v-share-email {
  background: rgba(255, 255, 255, 0.12);
}

.v-share-facebook {
  background: #1877F2;
}

.v-share-reddit {
  background: #FF4500;
}

.v-share-linkedin {
  background: #0A66C2;
}

.light-mode .v-share-email {
  background: rgba(0, 0, 0, 0.08);
  color: #1a1a1c;
}

.v-milestones {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}

.light-mode .v-milestones {
  background: rgba(0, 0, 0, 0.03);
}

.v-milestones-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  margin-bottom: 12px;
}

.light-mode .v-milestones-title {
  color: rgba(0, 0, 0, 0.4);
}

.v-milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.light-mode .v-milestone {
  color: rgba(0, 0, 0, 0.6);
}

.v-milestone-check {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.3);
  width: 18px;
  text-align: center;
}

.v-milestone.v-milestone-reached .v-milestone-check {
  color: var(--m3-primary);
}

.v-milestone.v-milestone-reached {
  color: var(--m3-primary);
}

.v-milestone-text strong {
  color: rgba(255, 255, 255, 0.85);
}

.light-mode .v-milestone-text strong {
  color: rgba(0, 0, 0, 0.85);
}

.v-milestone.v-milestone-reached .v-milestone-text strong {
  color: var(--m3-primary);
}

.v-referral-counter {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.light-mode .v-referral-counter {
  color: rgba(0, 0, 0, 0.5);
}

#v-ref-count {
  font-weight: 800;
  color: var(--m3-primary);
  font-size: 18px;
}

/* --- Light Mode Compatibility (v-dialog only) --- */

.light-mode .v-modal-card {
  background: rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(40px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
  border: none !important;
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.12),
              inset 0 -1px 2px rgba(0, 0, 0, 0.03) !important;
  color: #1a1a1c !important;
}

.light-mode .v-label {
  color: rgba(0, 0, 0, 0.55) !important;
}

.light-mode .v-input {
  background: rgba(255, 255, 255, 0.3) !important;
  border: none !important;
  color: #1a1a1c !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.light-mode .v-input:focus {
  background: rgba(255, 255, 255, 0.45) !important;
  border: none !important;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 2px var(--m3-primary) !important;
}

.light-mode .v-input::placeholder {
  color: rgba(0, 0, 0, 0.4) !important;
}

.light-mode .v-os-pills {
  background: rgba(255, 255, 255, 0.25) !important;
  border: none !important;
}

.light-mode .v-os-pill {
  color: rgba(0, 0, 0, 0.65) !important;
}

.light-mode .v-os-pill.active {
  background: var(--m3-primary) !important;
  color: var(--m3-on-primary) !important;
}

.light-mode .v-checkbox-checkmark {
  background: rgba(255, 255, 255, 0.4) !important;
  border: none !important;
}

.light-mode .v-checkbox-text {
  color: rgba(0, 0, 0, 0.6) !important;
}

.light-mode .v-checkbox-container:hover .v-checkbox-text {
  color: #1a1a1c !important;
}

.light-mode .v-checkbox-checkmark:after {
  border-color: #1a1a1c !important; /* Dark checkmark for light glass */
}

.light-mode .v-description {
  color: rgba(0, 0, 0, 0.8) !important;
}

.light-mode .v-modal-subtitle {
  color: rgba(0, 0, 0, 0.6) !important;
}

.light-mode .v-modal-title {
  color: #1a1a1c !important;
}

/* --- LOADING SPINNER --- */
.v-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: v-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* --- ERROR MESSAGING --- */
.v-error-msg {
  color: #ff5f8f;
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  margin-top: 10px;
  margin-left: 4px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
}

.v-error-msg.hidden {
  display: block !important; /* Keep in DOM for layout consistency if preferred, or hide */
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  height: 0;
  margin-top: 0;
  overflow: hidden;
}

/* Centered mode (when opened from CTA, not hero) */
.v-modal-card.v-centered {
  left: 50% !important;
  top: 50% !important;
}

/* Tablet Overrides */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .v-modal-card {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
}

/* Mobile Overrides */
@media screen and (max-width: 767px) {
  .v-modal-card {
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: calc(100% - 32px) !important;
    max-width: 400px !important;
    padding: 24px !important;
    top: 50% !important;
  }

  .v-share-buttons {
    gap: 6px;
  }

  .v-share-btn {
    width: 26px;
    height: 22px;
  }

  .v-share-btn svg {
    width: 12px;
    height: 12px;
  }
}
