/* 
  Amoura Store - Launch Landing Page Stylesheet
  Premium CSS Design System with light/dark theme toggle,
  custom animated silk/velvet backdrop, and glassmorphic card design.
*/

/* --- Design System & CSS Variables --- */
:root {
  /* Core brand palette */
  --brand-burgundy: #4c0303;
  --brand-burgundy-rgb: 76, 3, 3;
  --accent-gold: #c5a880;
  --accent-gold-hover: #b09168;
  --accent-gold-rgb: 197, 168, 128;
  
  /* Fonts */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Dark Theme Palette (Default) */
  --bg-1: #0d0102;
  --bg-2: #1e0204;
  --bg-3: #2d0306;
  --card-bg: rgba(26, 2, 4, 0.55);
  --card-border: rgba(255, 255, 255, 0.05);
  --card-shadow: rgba(0, 0, 0, 0.65);
  --text-primary: #fbf9f6;
  --text-secondary: #d8ced3;
  --text-muted: #9c8a8e;
  
  --input-bg: rgba(255, 255, 255, 0.02);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus-border: var(--accent-gold);
  --input-text: #fbf9f6;
  
  --btn-bg: var(--accent-gold);
  --btn-text: var(--brand-burgundy);
  --btn-hover-bg: #fbf9f6;
  --btn-hover-text: var(--brand-burgundy);
  
  --timer-bg: rgba(255, 255, 255, 0.03);
  --timer-border: rgba(255, 255, 255, 0.06);
  --timer-num-color: var(--accent-gold);
  
  --error-color: #ff6b6b;
  --error-bg: rgba(255, 107, 107, 0.1);
  --success-color: #51cf66;
  --success-bg: rgba(81, 207, 102, 0.1);
  
  /* Transition timings */
  --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: all 0.2s ease;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-1: #faf7f5;
  --bg-2: #f3eae3;
  --bg-3: #ebdcd0;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(76, 3, 3, 0.06);
  --card-shadow: rgba(76, 3, 3, 0.08);
  --text-primary: var(--brand-burgundy);
  --text-secondary: #634749;
  --text-muted: #8d7072;
  
  --input-bg: rgba(76, 3, 3, 0.02);
  --input-border: rgba(76, 3, 3, 0.12);
  --input-focus-border: var(--brand-burgundy);
  --input-text: var(--brand-burgundy);
  
  --btn-bg: var(--brand-burgundy);
  --btn-text: #fbf9f6;
  --btn-hover-bg: var(--accent-gold);
  --btn-hover-text: var(--brand-burgundy);
  
  --timer-bg: rgba(76, 3, 3, 0.03);
  --timer-border: rgba(76, 3, 3, 0.06);
  --timer-num-color: var(--brand-burgundy);
  
  --error-color: #c92a2a;
  --error-bg: rgba(201, 42, 42, 0.08);
  --success-color: #2b8a3e;
  --success-bg: rgba(43, 138, 62, 0.08);
}

/* --- Base Reset & Typography --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-1);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  transition: var(--transition-smooth);
  accent-color: var(--accent-gold);
}

/* --- Animated Backdrop (Satin Folds Simulation) --- */
.backdrop-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  transition: var(--transition-smooth);
}

.glowing-orbs {
  position: absolute;
  width: 100%;
  height: 100%;
  filter: blur(80px);
  opacity: 0.65;
  mix-blend-mode: normal;
  z-index: 1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  animation: float 25s infinite alternate ease-in-out;
  transition: var(--transition-smooth);
}

.orb-1 {
  top: -15%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(var(--brand-burgundy-rgb), 0.7) 0%, rgba(var(--brand-burgundy-rgb), 0) 70%);
}

.orb-2 {
  bottom: -20%;
  right: -10%;
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(var(--accent-gold-rgb), 0.28) 0%, rgba(var(--accent-gold-rgb), 0) 70%);
  animation-delay: -7s;
}

.orb-3 {
  top: 35%;
  left: 25%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(var(--brand-burgundy-rgb), 0.5) 0%, rgba(var(--brand-burgundy-rgb), 0) 70%);
  animation-delay: -14s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(4%, 6%) scale(1.08) rotate(45deg);
  }
  100% {
    transform: translate(-3%, -4%) scale(0.95) rotate(-30deg);
  }
}

/* Subtle overlay pattern */
.overlay-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 2;
  pointer-events: none;
  opacity: 0.8;
}

[data-theme="light"] .overlay-pattern {
  background-image: radial-gradient(rgba(76, 3, 3, 0.02) 1px, transparent 1px);
}

/* --- Theme Switcher Button --- */
.theme-toggle-container {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 10;
}

.theme-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: var(--transition-fast);
  backdrop-filter: blur(10px);
}

.theme-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.theme-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.5s ease;
}

.theme-btn:hover svg {
  transform: rotate(30deg);
}

/* Show sun or moon depending on current theme */
.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

/* --- Main Layout Container --- */
main {
  width: 100%;
  max-width: 720px;
  padding: 40px 24px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Glassmorphic Card Container --- */
.card {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 56px 48px;
  box-shadow: 0 32px 64px var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* Accent top line */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* --- Logo Styling --- */
.logo-container {
  margin-bottom: 36px;
  max-width: 240px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
}

.logo-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: var(--transition-smooth);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.logo-dark-theme { display: block; }
.logo-light-theme { display: none; }

[data-theme="light"] .logo-dark-theme { display: none; }
[data-theme="light"] .logo-light-theme { display: block; }

/* --- Typography --- */
h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 2.85rem;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.subtitle {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 460px;
  margin-bottom: 40px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

/* --- Countdown Timer Grid --- */
.timer-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 44px;
}

.timer-box {
  background: var(--timer-bg);
  border: 1px solid var(--timer-border);
  border-radius: 16px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.01);
  transition: var(--transition-smooth);
}

.timer-number {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 400;
  color: var(--timer-num-color);
  line-height: 1.1;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  transition: var(--transition-smooth);
}

.timer-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

/* --- Subscription Form --- */
.signup-form {
  width: 100%;
  max-width: 480px;
  position: relative;
  margin-bottom: 40px;
}

.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.signup-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 50px;
  padding: 18px 140px 18px 28px; /* Extra right padding for absolute button */
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--input-text);
  outline: none;
  transition: var(--transition-fast);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

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

.signup-input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(var(--accent-gold-rgb), 0.15);
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .signup-input:focus {
  box-shadow: 0 0 0 3px rgba(76, 3, 3, 0.06);
  background: rgba(255, 255, 255, 0.6);
}

/* Absolute styled button inside the input container */
.signup-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  background: var(--btn-bg);
  border: none;
  color: var(--btn-text);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 24px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.signup-btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: translateX(1px);
}

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

/* Accessibility and Constraint Validation styling (:user-invalid) */
.email-error {
  display: none;
  color: var(--error-color);
  background: var(--error-bg);
  font-size: 0.82rem;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  text-align: left;
  border: 1px solid rgba(255, 107, 107, 0.15);
  animation: fadeIn 0.3s ease forwards;
}

[data-theme="light"] .email-error {
  border-color: rgba(201, 42, 42, 0.15);
}

.signup-input:user-invalid {
  border-color: var(--error-color);
  background-color: var(--error-bg);
}

.signup-input:user-invalid ~ .email-error {
  display: block;
}

.signup-input:user-valid {
  border-color: var(--success-color);
}

/* --- Form Success Anim --- */
.success-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(81, 207, 102, 0.2);
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.success-text {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Social Links Footer --- */
.social-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 12px;
}

.social-link {
  color: var(--text-secondary);
  background: var(--timer-bg);
  border: 1px solid var(--timer-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-fast);
  text-decoration: none;
}

.social-link:hover {
  transform: translateY(-3px);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  background: rgba(var(--accent-gold-rgb), 0.05);
}

.social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Responsive Adaptations --- */
@media (max-width: 600px) {
  .theme-toggle-container {
    top: 20px;
    right: 20px;
  }
  
  main {
    padding: 80px 16px 40px;
  }

  .card {
    padding: 44px 24px;
    border-radius: 20px;
  }

  h1 {
    font-size: 2.1rem;
  }

  .subtitle {
    font-size: 0.95rem;
    margin-bottom: 32px;
  }

  .timer-container {
    gap: 10px;
    margin-bottom: 36px;
  }

  .timer-box {
    border-radius: 12px;
    padding: 12px 4px;
  }

  .timer-number {
    font-size: 1.6rem;
  }

  .timer-label {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .signup-input {
    padding: 16px 20px;
    border-radius: 28px;
    margin-bottom: 12px;
    text-align: center;
  }

  .signup-btn {
    position: static;
    width: 100%;
    padding: 16px;
    border-radius: 28px;
    margin-top: 8px;
  }
}
