/* ========================================
   flowstate.com.ge — Coming Soon
   Styles: Glassmorphism, Parallax, Themes
   ======================================== */

/* ---------- CSS Variables / Theming ---------- */
:root {
  /* Shared */
  --font-main: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --radius-card: 28px;
  --transition-theme: 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #181b25;
  --text-primary: #e8eaf0;
  --text-secondary: #9ea3b5;
  --text-muted: #6b7089;
  --accent: #7c8cf8;
  --accent-soft: rgba(124, 140, 248, 0.15);
  --accent-glow: rgba(124, 140, 248, 0.35);

  --glass-bg: rgba(24, 27, 37, 0.55);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 60px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.25);
  --glass-glow: 0 0 80px rgba(124, 140, 248, 0.06);

  --gradient-1: radial-gradient(ellipse at 30% 20%, rgba(124, 140, 248, 0.08) 0%, transparent 60%);
  --gradient-2: radial-gradient(ellipse at 70% 80%, rgba(168, 130, 255, 0.06) 0%, transparent 55%);

  --cursor-glow: radial-gradient(circle, rgba(140, 160, 255, 0.12) 0%, transparent 70%);

  --float-color: rgba(255, 255, 255, 0.018);

  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.08);
  --input-focus-border: rgba(124, 140, 248, 0.4);

  --btn-bg: var(--accent);
  --btn-text: #fff;
  --btn-hover: #6b7de8;

  --success-bg: rgba(80, 200, 140, 0.1);
  --success-border: rgba(80, 200, 140, 0.2);
  --success-text: #6fddaa;

  --toggle-bg: rgba(255, 255, 255, 0.06);
  --toggle-hover: rgba(255, 255, 255, 0.1);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #f4f2ef;
  --bg-secondary: #eae7e2;
  --text-primary: #1c1e26;
  --text-secondary: #5a5d6e;
  --text-muted: #8b8e9e;
  --accent: #5b6ad4;
  --accent-soft: rgba(91, 106, 212, 0.1);
  --accent-glow: rgba(91, 106, 212, 0.2);

  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 60px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
  --glass-glow: 0 0 80px rgba(91, 106, 212, 0.04);

  --gradient-1: radial-gradient(ellipse at 30% 20%, rgba(91, 106, 212, 0.07) 0%, transparent 60%);
  --gradient-2: radial-gradient(ellipse at 70% 80%, rgba(200, 160, 220, 0.06) 0%, transparent 55%);

  --cursor-glow: radial-gradient(circle, rgba(200, 170, 120, 0.1) 0%, transparent 70%);

  --float-color: rgba(0, 0, 0, 0.022);

  --input-bg: rgba(0, 0, 0, 0.03);
  --input-border: rgba(0, 0, 0, 0.08);
  --input-focus-border: rgba(91, 106, 212, 0.45);

  --btn-bg: var(--accent);
  --btn-text: #fff;
  --btn-hover: #4a59c3;

  --success-bg: rgba(60, 180, 120, 0.08);
  --success-border: rgba(60, 180, 120, 0.18);
  --success-text: #3aaa75;

  --toggle-bg: rgba(0, 0, 0, 0.05);
  --toggle-hover: rgba(0, 0, 0, 0.09);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition:
    background var(--transition-theme),
    color var(--transition-theme);
}

/* ---------- Cursor Glow ---------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  background: var(--cursor-glow);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition:
    opacity 0.4s ease,
    background var(--transition-theme);
  will-change: transform;
}

body:hover .cursor-glow {
  opacity: 1;
}

/* ---------- Floating Background Text ---------- */
.floating-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.float-text {
  position: absolute;
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 800;
  color: var(--float-color);
  white-space: nowrap;
  letter-spacing: 0.04em;
  user-select: none;
  will-change: transform;
  transition: color var(--transition-theme);
}

/* Staggered positions & animations */
.float-1 {
  top: 5%;
  left: -5%;
  animation: floatDrift1 28s ease-in-out infinite;
}
.float-2 {
  top: 30%;
  right: -8%;
  font-size: clamp(3rem, 7vw, 7rem);
  animation: floatDrift2 34s ease-in-out infinite;
}
.float-3 {
  bottom: 18%;
  left: 10%;
  font-size: clamp(3.5rem, 8vw, 8rem);
  animation: floatDrift3 30s ease-in-out infinite;
}
.float-4 {
  top: 60%;
  right: 5%;
  font-size: clamp(2.5rem, 6vw, 6rem);
  animation: floatDrift4 36s ease-in-out infinite;
}
.float-5 {
  top: 85%;
  left: 30%;
  font-size: clamp(3rem, 9vw, 9rem);
  animation: floatDrift5 32s ease-in-out infinite;
}

@keyframes floatDrift1 {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  25%      { transform: translate(40px, 20px) rotate(0deg); }
  50%      { transform: translate(-20px, 40px) rotate(1deg); }
  75%      { transform: translate(30px, -15px) rotate(-1deg); }
}
@keyframes floatDrift2 {
  0%, 100% { transform: translate(0, 0) rotate(1deg); }
  33%      { transform: translate(-35px, 25px) rotate(-1deg); }
  66%      { transform: translate(25px, -30px) rotate(0.5deg); }
}
@keyframes floatDrift3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20%      { transform: translate(30px, -20px) rotate(1.5deg); }
  50%      { transform: translate(-40px, 15px) rotate(-1deg); }
  80%      { transform: translate(20px, 30px) rotate(0.5deg); }
}
@keyframes floatDrift4 {
  0%, 100% { transform: translate(0, 0) rotate(-0.5deg); }
  40%      { transform: translate(-25px, -35px) rotate(1deg); }
  70%      { transform: translate(35px, 20px) rotate(-1.5deg); }
}
@keyframes floatDrift5 {
  0%, 100% { transform: translate(0, 0) rotate(0.5deg); }
  30%      { transform: translate(45px, -10px) rotate(-1deg); }
  60%      { transform: translate(-30px, -25px) rotate(1deg); }
}

/* ---------- Parallax Gradient Layers ---------- */
.parallax-layer {
  position: fixed;
  inset: -60px;
  pointer-events: none;
  z-index: 0;
  transition: background var(--transition-theme);
  will-change: transform;
}

.parallax-1 {
  background: var(--gradient-1);
}
.parallax-2 {
  background: var(--gradient-2);
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--toggle-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-toggle:hover {
  background: var(--toggle-hover);
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  position: absolute;
}

/* Icon visibility based on theme */
[data-theme="dark"] .icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="light"] .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
}

/* ---------- Glassmorphism Card ---------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-shadow), var(--glass-glow);
  padding: 56px 48px 48px;
  max-width: 540px;
  width: 100%;
  text-align: center;
  transition:
    background var(--transition-theme),
    border-color var(--transition-theme),
    box-shadow var(--transition-theme),
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Page-load animation */
  opacity: 0;
  transform: translateY(32px);
  animation: cardEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow:
    var(--glass-shadow),
    0 0 100px rgba(124, 140, 248, 0.08);
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Typography ---------- */
.brand {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 18px;
  transition: color var(--transition-theme);
}

.subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 400;
  transition: color var(--transition-theme);
}

.tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 36px;
  font-weight: 500;
  transition: color var(--transition-theme);
}

/* ---------- Subscribe Form ---------- */
.subscribe-form {
  width: 100%;
}

.form-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.email-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 14px;
  outline: none;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease,
    color var(--transition-theme);
}

.email-input::placeholder {
  color: var(--text-muted);
  transition: color var(--transition-theme);
}

.email-input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Error state */
.email-input.error {
  border-color: #e05454;
  box-shadow: 0 0 0 3px rgba(224, 84, 84, 0.12);
}

.form-error {
  font-size: 0.8rem;
  color: #e05454;
  margin-top: 10px;
  min-height: 1.2em;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.form-error.visible {
  opacity: 1;
}

/* ---------- Submit Button ---------- */
.submit-btn {
  padding: 14px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-main);
  color: var(--btn-text);
  background: var(--btn-bg);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    background 0.3s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
}

.submit-btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.submit-btn:active {
  transform: translateY(0) scale(0.97);
}

.submit-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.submit-btn:hover .btn-icon svg {
  transform: translateX(3px);
}

/* Loading state */
.submit-btn.loading {
  pointer-events: none;
  opacity: 0.75;
}

.submit-btn.loading .btn-text::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Success Message ---------- */
.success-msg {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 14px;
  color: var(--success-text);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background var(--transition-theme),
    border-color var(--transition-theme),
    color var(--transition-theme);
}

.success-msg.visible {
  display: flex;
  /* Animation triggered via JS after display:flex is set */
}

.success-msg.animate {
  opacity: 1;
  transform: translateY(0);
}

.success-msg svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 540px) {
  .glass-card {
    padding: 40px 28px 36px;
    border-radius: 22px;
  }

  .form-group {
    flex-direction: column;
  }

  .submit-btn {
    justify-content: center;
  }

  .theme-toggle {
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
  }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .glass-card {
    opacity: 1;
    transform: none;
  }
}
