/* ==========================================================================
   WPTeam247 — Modern Web Guidance Optimized Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Support */
:root {
  /* Brand colors */
  --brand-primary: #008061;
  --brand-dark: #006b51;
  --brand-light: #00a37b;
  --brand-accent-glow: rgba(0, 128, 97, 0.15);
  
  /* Semantic Tokens for Light/Dark mode (Default Light Mode) */
  --bg-color: #f4f4f5;
  --text-primary: #0a0a0a;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-heading-dim: #9ca3af;
  --border-color: #d4d4d8;
  --border-focus: #0a0a0a;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(0, 0, 0, 0.08);
  --grid-line-color: rgba(0, 0, 0, 0.04);
  --glow-bg: radial-gradient(circle at center, rgba(0, 128, 97, 0.16) 0%, rgba(0, 128, 97, 0.05) 45%, transparent 70%);
  --error-color: #dc2626;

  /* Form control accent */
  accent-color: var(--brand-primary);
  color-scheme: light dark;
}

/* System Dark Preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #090d0b;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-heading-dim: #52525b;
    --border-color: #27272a;
    --border-focus: #00a37b;
    --card-bg: rgba(18, 24, 22, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --grid-line-color: rgba(255, 255, 255, 0.03);
    --glow-bg: radial-gradient(circle at center, rgba(0, 163, 123, 0.22) 0%, rgba(0, 163, 123, 0.06) 50%, transparent 75%);
    --error-color: #f87171;
  }

  :root:not([data-theme="light"]) .logo-img {
    content: url('logo-dark.png');
  }

  :root:not([data-theme="light"]) .sun-icon {
    display: block !important;
  }

  :root:not([data-theme="light"]) .moon-icon {
    display: none !important;
  }
}

/* Explicit Pinned Dark Mode */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-color: #090d0b;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-heading-dim: #52525b;
  --border-color: #27272a;
  --border-focus: #00a37b;
  --card-bg: rgba(18, 24, 22, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --grid-line-color: rgba(255, 255, 255, 0.03);
  --glow-bg: radial-gradient(circle at center, rgba(0, 163, 123, 0.22) 0%, rgba(0, 163, 123, 0.06) 50%, transparent 75%);
  --error-color: #f87171;
}

html[data-theme="dark"] .logo-img {
  content: url('logo-dark.png');
}

html[data-theme="dark"] .sun-icon {
  display: block !important;
}

html[data-theme="dark"] .moon-icon {
  display: none !important;
}

/* Explicit Pinned Light Mode */
html[data-theme="light"] {
  color-scheme: light;
  --bg-color: #f4f4f5;
  --text-primary: #0a0a0a;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-heading-dim: #9ca3af;
  --border-color: #d4d4d8;
  --border-focus: #0a0a0a;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(0, 0, 0, 0.08);
  --grid-line-color: rgba(0, 0, 0, 0.04);
  --glow-bg: radial-gradient(circle at center, rgba(0, 128, 97, 0.16) 0%, rgba(0, 128, 97, 0.05) 45%, transparent 70%);
  --error-color: #dc2626;
}

html[data-theme="light"] .logo-img {
  content: url('logo.png');
}

html[data-theme="light"] .sun-icon {
  display: none !important;
}

html[data-theme="light"] .moon-icon {
  display: block !important;
}

/* Theme Icon Default Visibility */
.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

/* Modern CSS light-dark() progressive enhancement */
@supports (color: light-dark(black, white)) {
  :root:not([data-theme]) {
    --bg-color: light-dark(#f4f4f5, #090d0b);
    --text-primary: light-dark(#0a0a0a, #f4f4f5);
    --text-secondary: light-dark(#52525b, #a1a1aa);
    --text-muted: light-dark(#71717a, #71717a);
    --text-heading-dim: light-dark(#9ca3af, #52525b);
    --border-color: light-dark(#d4d4d8, #27272a);
    --border-focus: light-dark(#0a0a0a, #00a37b);
    --card-bg: light-dark(rgba(255, 255, 255, 0.75), rgba(18, 24, 22, 0.75));
    --card-border: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.08));
    --grid-line-color: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.03));
  }
}

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

html {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

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

/* Background & Grid Pattern */
.grid-lines {
  background-image: linear-gradient(to right, var(--grid-line-color) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%;
}

.page-container {
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Outer Wrapper for Perfect Grid Alignment */
.site-wrapper {
  max-width: 80rem; /* 1280px */
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 1.5rem;
}

@media (min-width: 640px) {
  .site-wrapper {
    padding: 0 2.5rem;
  }
}

/* Header */
.site-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  z-index: 20;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  border-radius: 0.5rem;
}

.logo-link:hover {
  opacity: 0.9;
}

.logo-link:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 4px;
}

/* Logo Image Sizing */
.logo-img {
  height: 3.75rem; /* 60px */
  width: auto;
  max-width: 12rem;
  object-fit: contain;
  background: transparent;
  border: none;
  box-shadow: none;
}

@media (min-width: 640px) {
  .logo-img {
    height: 4.25rem; /* 68px */
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.contact-link {
  display: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

@media (min-width: 640px) {
  .contact-link {
    display: inline-flex;
  }
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--text-primary);
  outline: none;
  text-decoration: underline;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn:hover {
  border-color: var(--brand-light);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
}

/* Main Layout */
.main-content {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3.5rem;
  padding: 3rem 0;
  flex: 1;
}

@media (min-width: 1024px) {
  .main-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 4rem;
    padding: 4rem 0;
  }
}

/* Headline Typography */
.headline-section {
  display: flex;
  flex-direction: column;
}

.headline {
  font-size: clamp(3.2rem, 7.5vw, 5.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--text-primary);
  /* Modern Web Guidance: Balanced text wrapping for headings */
  text-wrap: balance;
}

.headline-line {
  display: block;
}

.headline-line-dim {
  display: block;
  color: var(--text-heading-dim);
}

.subheadline {
  margin-top: 2rem;
  max-width: 30rem;
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  /* Modern Web Guidance: Pretty text wrapping for body paragraphs */
  text-wrap: pretty;
}

/* Form Container & Glass Card */
.form-section {
  position: relative;
}

.glow-backdrop {
  pointer-events: none;
  position: absolute;
  inset: -3rem;
  background: var(--glow-bg);
  filter: blur(40px);
  border-radius: 50%;
  z-index: 0;
}

.form-card {
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  padding: 2.25rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
}

/* Modern CSS :has() selector for interactive focus ring on card */
.form-card:has(:focus-visible) {
  border-color: var(--brand-light);
  box-shadow: 0 20px 45px -10px rgba(0, 128, 97, 0.15);
}

.form-label-title {
  margin-bottom: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* Input Group */
.waitlist-form {
  border-bottom: 2px solid var(--border-color);
}

.waitlist-form:focus-within {
  border-color: var(--border-focus);
}

.input-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.email-input {
  width: 100%;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-primary);
  font-family: inherit;
}

@media (min-width: 640px) {
  .email-input {
    font-size: 1.875rem;
  }
}

.email-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.email-input:focus {
  outline: none;
}

/* Modern Web Guidance: Visual :user-invalid state styling */
.email-input:user-invalid {
  color: var(--error-color);
}

.waitlist-form:has(.email-input:user-invalid) {
  border-color: var(--error-color);
}

/* Submit Button */
.submit-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waitlist-form:focus-within .submit-btn {
  color: var(--text-primary);
}

.submit-btn:hover {
  color: var(--brand-primary);
}

.submit-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.submit-icon {
  width: 1.75rem;
  height: 1.75rem;
  stroke: currentColor;
}

/* Messages & Notes */
.form-message {
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-message.hidden {
  display: none;
}

.form-message.success {
  color: var(--brand-primary);
}

.form-message.error {
  color: var(--error-color);
}

.form-disclaimer {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2rem 0;
  font-size: 0.875rem;
  z-index: 20;
}

@media (min-width: 640px) {
  .site-footer {
    flex-direction: row;
    align-items: center;
  }
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.status-dot-wrapper {
  position: relative;
  display: flex;
  height: 0.625rem;
  width: 0.625rem;
}

.status-dot-pulse {
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  background-color: var(--brand-light);
  opacity: 0.75;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-dot {
  position: relative;
  display: inline-flex;
  border-radius: 50%;
  height: 0.625rem;
  width: 0.625rem;
  background-color: var(--brand-primary);
}

@keyframes ping {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.status-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.copyright {
  color: var(--text-muted);
}
