/* ==========================================================================
   WAKESOL — Engineered Everyday Essentials
   Design: Refined Off-White Card on Vibrant Orange Canvas with Animated Beige Spiral
   Palette:
   - Surrounding Background: Vibrant Orange #F27A0B
   - Card & Spiral Background: Warm Off-White / Beige #F3E9D0 / #F5EEDB
   - Typography Charcoal: #181513
   - Accent Terracotta: #A2582D / #9E562F
   - Muted Micro-copy: #9C7D6B / #9C6544
   - Divider Dash: #D3BEAB
   - Button Gradient: #F9B38F to #EE7944
   Fonts:
   - Primary Display: Gambarino Regular
   - Secondary Text & UI: Manrope (400, 500, 600, 700, 800)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Variables & Tokens
   -------------------------------------------------------------------------- */
:root {
  --wakesol-orange: #F27A0B;
  --wakesol-orange-dark: #D36302;
  --wakesol-orange-light: #FFA142;

  --wakesol-btn-start: #F9B38F;
  --wakesol-btn-end: #EE7944;

  --wakesol-card-bg: #F5EEDB;
  --wakesol-beige-pattern: #F3E9D0;
  --wakesol-card-surface: #FAF4E5;
  --wakesol-white: #FFFFFF;

  --wakesol-charcoal: #181513;
  --wakesol-overline: #A2582D;
  --wakesol-subtext: #9C6544;
  --wakesol-muted: #9C7D6B;
  --wakesol-divider: #D3BEAB;

  --font-display: 'Gambarino', 'Fraunces', Georgia, serif;
  --font-secondary: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --ease-luxury: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & Global Setup
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--wakesol-orange);
  color: var(--wakesol-charcoal);
  font-family: var(--font-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background-color: var(--wakesol-orange);
  color: var(--wakesol-charcoal);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

::selection {
  background-color: var(--wakesol-charcoal);
  color: #FFFFFF;
}

/* Screen reader accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------------------------------
   3. Opening Intro Animation Curtain (HQ Untouched Logo on Orange)
   -------------------------------------------------------------------------- */
.intro-curtain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--wakesol-orange);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1.1s var(--ease-luxury), opacity 0.8s ease;
  will-change: transform;
}

.intro-curtain.dismissed {
  transform: translateY(-100%);
  pointer-events: none;
}

.intro-logo-box {
  width: clamp(260px, 36vw, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: scale(0.92);
  animation: introLogoReveal 1.2s var(--ease-luxury) forwards 0.2s;
}

@keyframes introLogoReveal {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.intro-logo-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.22));
}

.intro-loading-line {
  width: 140px;
  height: 2.5px;
  background: rgba(245, 238, 219, 0.35);
  border-radius: 99px;
  margin-top: 26px;
  overflow: hidden;
  position: relative;
}

.intro-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--wakesol-card-bg);
  animation: introProgress 1.4s var(--ease-smooth) forwards 0.3s;
}

@keyframes introProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* --------------------------------------------------------------------------
   4. Beige Animated Spiral & Network Pattern (Noticeable & Continuous)
   -------------------------------------------------------------------------- */
.bg-spiral-network-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.spiral-svg-art {
  width: clamp(1000px, 130vw, 1700px);
  height: clamp(1000px, 130vw, 1700px);
  flex-shrink: 0;
  overflow: visible;
}

/* Primary Smooth Continuous Rotation */
.rotating-spiral-group {
  transform-origin: 700px 700px;
  animation: slowSpiralRotate 48s linear infinite;
  will-change: transform;
}

/* Counter-Rotating Harmonic Rings */
.counter-rotating-group {
  transform-origin: 700px 700px;
  animation: slowCounterRotate 68s linear infinite;
  will-change: transform;
}

/* Network Constellation Pulse */
.network-points-group {
  transform-origin: 700px 700px;
  animation: networkPointGlow 8s ease-in-out infinite alternate;
}

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

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

@keyframes networkPointGlow {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.04); opacity: 1; filter: drop-shadow(0 0 8px rgba(243, 233, 208, 0.6)); }
}

.noise-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.08'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   5. Viewport Stage & Central Card Object
   -------------------------------------------------------------------------- */
.viewport-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 60px) 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Central Card Object */
.wakesol-main-card {
  width: 100%;
  max-width: 480px;
  background-color: var(--wakesol-card-bg);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 
    0 34px 95px -20px rgba(0, 0, 0, 0.32),
    0 14px 38px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease;
}

.wakesol-main-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 44px 110px -22px rgba(0, 0, 0, 0.38),
    0 18px 46px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.45);
}

/* --------------------------------------------------------------------------
   6. Top Header Row: WAKESOL Logo (Left)
   -------------------------------------------------------------------------- */
.card-top-bar {
  width: 100%;
  padding: 26px 28px 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

@media (max-width: 480px) {
  .card-top-bar {
    padding: 22px 20px 8px;
  }
}

.card-corner-logo {
  display: flex;
  align-items: center;
}

.top-bar-logo-img {
  width: clamp(100px, 25vw, 125px);
  height: auto;
  object-fit: contain;
  transition: transform 0.25s var(--ease-spring);
}

.top-bar-logo-img:hover {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   7. Card Body Content (Refined & Subtle Headline)
   -------------------------------------------------------------------------- */
.card-body {
  padding: 18px clamp(24px, 6vw, 36px) clamp(30px, 6vw, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Overline Tag */
.card-overline {
  font-family: var(--font-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--wakesol-overline);
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* Primary Display Headline (Refined, Subtle Font Size) */
.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3.5vw, 1.68rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--wakesol-charcoal);
  margin-bottom: 22px;
  max-width: 100%;
  text-wrap: balance;
}

/* Subhead Group (Manrope) */
.card-subhead-group {
  margin-bottom: 28px;
}

.card-subtitle {
  font-family: var(--font-secondary);
  font-size: clamp(1rem, 3.2vw, 1.1rem);
  font-weight: 700;
  color: var(--wakesol-charcoal);
  letter-spacing: -0.012em;
  line-height: 1.2;
  margin-bottom: 5px;
  text-wrap: balance;
}

.card-early-access {
  font-family: var(--font-secondary);
  font-size: 0.90rem;
  font-weight: 500;
  color: var(--wakesol-subtext);
  letter-spacing: 0.005em;
}

/* --------------------------------------------------------------------------
   8. Waitlist Form Container & Pill Button
   -------------------------------------------------------------------------- */
.card-form-container {
  width: 100%;
  max-width: 420px;
  margin-bottom: 30px;
}

.wakesol-waitlist-form {
  position: relative;
  width: 100%;
}

.pill-input-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--wakesol-white);
  border: 1.5px solid rgba(216, 192, 168, 0.75);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-shadow: 
    0 12px 30px -10px rgba(180, 95, 30, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.28s var(--ease-smooth);
}

.pill-input-wrapper:focus-within {
  border-color: var(--wakesol-orange);
  box-shadow: 
    0 14px 34px -8px rgba(242, 122, 11, 0.22),
    0 0 0 3.5px rgba(242, 122, 11, 0.15);
  transform: translateY(-2px);
}

.pill-input-wrapper.has-error {
  border-color: #D32F2F;
  animation: shakeCardForm 0.4s var(--ease-spring);
}

@keyframes shakeCardForm {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.pill-text-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-secondary);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--wakesol-charcoal);
  padding: 8px 4px;
  min-width: 0;
}

.pill-text-input::placeholder {
  color: #B5A496;
  font-weight: 400;
  transition: color 0.2s ease;
}

.pill-text-input:focus::placeholder {
  color: #D0C3B8;
}

/* Join Button with Warm Peach/Orange Gradient */
.pill-join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--wakesol-btn-start) 0%, var(--wakesol-btn-end) 100%);
  color: #FFFFFF;
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 12px 22px 12px 24px;
  font-family: var(--font-secondary);
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(238, 121, 68, 0.35);
  transition: all 0.25s var(--ease-smooth);
  flex-shrink: 0;
}

.pill-join-btn:hover {
  background: linear-gradient(135deg, #F8A77E 0%, #E66217 100%);
  box-shadow: 0 6px 18px rgba(242, 122, 11, 0.45);
  transform: scale(1.03);
}

.pill-join-btn:active {
  transform: scale(0.97);
}

.pill-join-btn .join-arrow {
  display: inline-block;
  font-size: 1.15rem;
  transition: transform 0.25s var(--ease-spring);
}

.pill-join-btn:hover .join-arrow {
  transform: translateX(4px);
}

/* Form Feedback Message */
.form-feedback-msg {
  min-height: 20px;
  margin-top: 8px;
  font-family: var(--font-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  color: #D32F2F;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.form-feedback-msg.visible {
  opacity: 1;
}

/* Success Card with Sun Icon */
.form-success-box {
  display: none;
  flex-direction: column;
  align-items: center;
  background: var(--wakesol-white);
  border: 1.5px solid rgba(242, 122, 11, 0.3);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 14px 34px -8px rgba(242, 122, 11, 0.2);
  animation: popSuccess 0.45s var(--ease-spring) forwards;
}

.form-success-box.active {
  display: flex;
}

@keyframes popSuccess {
  0% { opacity: 0; transform: scale(0.92) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.success-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wakesol-btn-start), var(--wakesol-btn-end));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(238, 121, 68, 0.3);
}

.success-title-with-sun {
  font-family: var(--font-secondary);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--wakesol-charcoal);
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sun-logo-glyph {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  animation: sunGlow 3.5s ease-in-out infinite alternate;
}

@keyframes sunGlow {
  0% { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(25deg) scale(1.1); }
}

.success-sub {
  font-family: var(--font-secondary);
  font-size: 0.88rem;
  color: var(--wakesol-subtext);
  margin-bottom: 14px;
}

.reset-email-btn {
  background: transparent;
  border: none;
  color: var(--wakesol-orange);
  font-family: var(--font-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}

/* Consent Disclaimer (Manrope Regular) */
.card-disclaimer {
  font-family: var(--font-secondary);
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--wakesol-muted);
  margin-top: 14px;
  padding: 0 8px;
}

/* --------------------------------------------------------------------------
   9. Connect Section Divider & Social Icons
   -------------------------------------------------------------------------- */
.card-divider-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  margin: 12px 0 22px;
  gap: 10px;
}

.divider-dash {
  flex: 1;
  border-bottom: 1.5px dashed var(--wakesol-divider);
  opacity: 0.85;
}

.divider-text {
  font-family: var(--font-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--wakesol-subtext);
  white-space: nowrap;
}

/* Social Buttons */
.card-social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(242, 122, 11, 0.08);
  color: var(--wakesol-orange);
  text-decoration: none;
  border: 1px solid rgba(242, 122, 11, 0.15);
  cursor: pointer;
  transition: all 0.28s var(--ease-spring);
  position: relative;
}

.social-icon-btn:hover {
  background: var(--wakesol-orange);
  color: #FFFFFF;
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px rgba(242, 122, 11, 0.35);
  border-color: transparent;
}

.social-icon-btn:active {
  transform: translateY(0) scale(0.96);
}

/* Tooltip on Social Links */
.social-icon-btn[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background-color: var(--wakesol-charcoal);
  color: #FFFFFF;
  font-family: var(--font-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-icon-btn[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Card Footer with Middle Dot */
.card-footer {
  margin-top: auto;
  padding-top: 6px;
}

.card-footer p {
  font-family: var(--font-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--wakesol-muted);
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   10. Toast Notification
   -------------------------------------------------------------------------- */
.wakesol-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background-color: var(--wakesol-charcoal);
  color: #FFFFFF;
  font-family: var(--font-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  z-index: 10000;
  transition: all 0.35s var(--ease-spring);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .rotating-spiral-group,
  .counter-rotating-group,
  .network-points-group,
  .sun-logo-glyph,
  .intro-curtain,
  .intro-logo-box,
  .wakesol-main-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
