/* Design Tokens & Theme Variables */
:root {
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Space Grotesk', sans-serif;

  /* Dark Theme (Default) */
  --bg-color: #030712;
  --bg-gradient: radial-gradient(circle at 50% 50%, #080f25 0%, #030712 100%);
  --card-bg: rgba(15, 23, 42, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --logo-navy-fill: #f8fafc; /* In dark mode, we draw the logo in white/silver for high contrast */
  --logo-orange: #ff6b00;
  
  --circle-bg: rgba(255, 255, 255, 0.04);
  --circle-border: rgba(255, 255, 255, 0.1);
  --circle-shadow: 0 0 15px rgba(255, 107, 0, 0.1);
  
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-text: #f8fafc;
  --input-focus-border: #ff6b00;
  --input-focus-shadow: 0 0 15px rgba(255, 107, 0, 0.25);
  
  --blob-opacity: 0.15;
  --canvas-opacity: 0.45;
}

html[data-theme="light"] {
  /* Light Theme */
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 50%, #f1f5f9 0%, #e2e8f0 100%);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(15, 23, 42, 0.06);
  --card-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --logo-navy-fill: #0b1a40; /* In light mode, we use the original brand navy */
  --logo-orange: #ff6b00;
  
  --circle-bg: rgba(15, 23, 42, 0.03);
  --circle-border: rgba(15, 23, 42, 0.08);
  --circle-shadow: 0 0 10px rgba(15, 23, 42, 0.05);
  
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(15, 23, 42, 0.12);
  --input-text: #0f172a;
  --input-focus-border: #ff6b00;
  --input-focus-shadow: 0 0 15px rgba(255, 107, 0, 0.15);
  
  --blob-opacity: 0.1;
  --canvas-opacity: 0.2;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s ease;
}

/* Background Canvas & Interactive Blobs */
#interactive-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: var(--canvas-opacity);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 0;
  opacity: var(--blob-opacity);
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.1s ease-out;
}

.blob-orange {
  width: 450px;
  height: 450px;
  background: #ff6b00;
  top: -10%;
  left: -5%;
  animation: float-slow 20s infinite alternate;
}

.blob-blue {
  width: 500px;
  height: 500px;
  background: #1e3a8a;
  bottom: -15%;
  right: -10%;
  animation: float-slower 25s infinite alternate;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.1); }
}

@keyframes float-slower {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-60px, -30px) scale(0.9); }
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 720px;
  padding: 20px;
  z-index: 2;
  perspective: 1000px;
}

/* Glassmorphic Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 45px 40px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: card-appear 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-style: preserve-3d;
}

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(30px) rotateX(4deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* Card Header & SVG Logo styling */
.card-header {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.logo-wrapper {
  width: 100%;
  max-width: 320px;
  padding: 5px;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.logo-wrapper:hover {
  transform: scale(1.02);
}

.logo-svg {
  width: 100%;
  height: auto;
}

.letter-navy {
  stroke: var(--logo-navy-fill);
  transition: stroke 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Content Area */
.card-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.headline {
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.subheadline {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 35px;
  font-weight: 400;
  transition: color 0.5s ease;
}

/* Countdown Grid */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 540px;
  margin-bottom: 40px;
}

.countdown-item {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring__circle-bg {
  stroke: var(--circle-bg);
  transition: stroke 0.8s ease;
}

.progress-ring__circle {
  stroke: url(#logo-orange-gradient);
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 4px rgba(255, 107, 0, 0.4));
}

.countdown-value-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.countdown-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  transition: color 0.5s ease;
}

.countdown-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
  transition: color 0.5s ease;
}

/* Subscription Form styling */
.subscription-form {
  width: 100%;
  max-width: 480px;
  margin-bottom: 10px;
}

.input-group {
  display: flex;
  position: relative;
  border-radius: 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 5px;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.8s ease;
}

.input-group:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
}

.email-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--input-text);
  font-weight: 400;
}

.email-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.email-input:focus::placeholder {
  opacity: 0.4;
}

.submit-btn {
  background: linear-gradient(135deg, #ff9e00, #ff6b00);
  border: none;
  outline: none;
  color: #ffffff;
  padding: 0 24px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.submit-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ffa81a, #ff7a1a);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

.submit-btn:active {
  transform: translateY(1px);
}

.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: 0.5s;
}

.submit-btn:hover .btn-glow {
  left: 100%;
  transition: 0.8s ease-in-out;
}

.form-feedback {
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 20px;
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.form-feedback.success {
  color: #10b981;
  opacity: 1;
}

.form-feedback.error {
  color: #ef4444;
  opacity: 1;
}

/* Card Footer & Themes Controls */
.card-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid var(--card-border);
  transition: border-color 0.8s ease;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  transition: color 0.5s ease;
}

.theme-toggle-btn {
  background: var(--circle-bg);
  border: 1px solid var(--circle-border);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-toggle-btn:hover {
  transform: rotate(20deg) scale(1.08);
  color: var(--logo-orange);
  background: var(--input-border);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

/* Sun/Moon visibility depending on data-theme */
html[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: scale(1) rotate(0);
}
html[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

html[data-theme="light"] .sun-icon {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}
html[data-theme="light"] .moon-icon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .glass-card {
    padding: 35px 25px;
    border-radius: 20px;
  }
  
  .headline {
    font-size: 1.75rem;
  }
  
  .subheadline {
    font-size: 0.9rem;
    margin-bottom: 25px;
  }
  
  .countdown-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 260px;
    margin-bottom: 30px;
  }
  
  .countdown-item {
    width: 100px;
    height: 100px;
  }
  
  .progress-ring {
    width: 100px;
    height: 100px;
  }
  
  .progress-ring circle {
    cx: 50;
    cy: 50;
    r: 44;
  }
  
  .progress-ring__circle {
    stroke-dasharray: 276.46;
    stroke-dashoffset: 276.46;
  }
  
  .countdown-value {
    font-size: 1.6rem;
  }
  
  .input-group {
    flex-direction: column;
    background: transparent;
    border: none;
    padding: 0;
    gap: 12px;
  }
  
  .input-group:focus-within {
    box-shadow: none;
  }
  
  .email-input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    width: 100%;
    transition: border-color 0.4s ease;
  }
  
  .email-input:focus {
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
  }
  
  .submit-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
  }
  
  .card-footer {
    flex-direction: column-reverse;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
  }
}
