/* ============================================
   FitConnect Design System
   Mobile-first • Premium fitness-tech aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Sora:wght@400;500;600;700;800&display=swap');

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

/* --- Custom Properties --- */
:root {
  --bg: #FAFBFC;
  --bg-hero: linear-gradient(180deg, #ECFDF5 0%, #FAFBFC 60%);
  --text: #0F1419;
  --text-secondary: #536471;
  --text-muted: #8B98A5;
  --accent: #0D6B4F;
  --accent-hover: #095C43;
  --accent-light: #10B981;
  --gradient: linear-gradient(135deg, #0D6B4F 0%, #10B981 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(13,107,79,0.08) 0%, rgba(16,185,129,0.08) 100%);
  --card-bg: #FFFFFF;
  --card-border: rgba(0, 0, 0, 0.06);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --success: #10B981;
  --success-bg: #ECFDF5;

  --font-heading: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.25rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --max-width: 1120px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.2s var(--ease);
  --transition-slow: 0.4s var(--ease-out);
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
}

h2 {
  font-size: var(--text-xl);
  font-weight: 700;
}

.subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 540px;
  margin: 0 auto;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-16) 0;
}

.text-center { text-align: center; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}

.logo {
  height: 36px;
  width: auto;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  background: var(--gradient);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(13, 107, 79, 0.25);
  text-decoration: none;
  gap: var(--space-2);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 107, 79, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(13, 107, 79, 0.25);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  gap: var(--space-2);
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(13, 107, 79, 0.04);
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--card-shadow);
  transition: all var(--transition-slow);
}

.card:hover {
  border-color: rgba(13, 107, 79, 0.2);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

/* --- Hero Section --- */
.hero {
  background: var(--bg-hero);
  padding: var(--space-12) 0 var(--space-16);
  text-align: center;
}

.hero h1 {
  margin-bottom: var(--space-4);
}

.hero .subtitle {
  margin-bottom: var(--space-8);
}

.hero .btn-primary {
  width: auto;
  min-width: 220px;
}

/* Video Placeholder */
.video-container {
  max-width: 640px;
  margin: 0 auto var(--space-10);
}

.hero-video {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  background: #0F172A;
  display: block;
}

.video-placeholder {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(145deg, #0F172A, #1E293B);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  overflow: hidden;
  cursor: pointer;
}

.video-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(13, 107, 79, 0.2), transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(16, 185, 129, 0.12), transparent 50%);
}

.play-button {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.play-button::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #FFFFFF;
  margin-left: 3px;
}

.video-placeholder:hover .play-button {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.35);
}

.video-label {
  position: relative;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Trust Section --- */
.trust {
  padding: var(--space-12) 0 var(--space-16);
  border-top: 1px solid var(--card-border);
}

.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  max-width: 800px;
  margin: 0 auto;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.trust-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

.trust-item p {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text);
}

/* --- Package Cards --- */
.packages {
  padding: var(--space-12) 0 var(--space-16);
}

.packages h1 {
  text-align: center;
  margin-bottom: var(--space-10);
}

.package-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: 960px;
  margin: 0 auto;
}

.package-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.package-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.package-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

.package-card h2 {
  margin-bottom: var(--space-2);
}

.package-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--gradient-subtle);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.package-card p.package-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.5;
  flex: 1;
}

.package-card .btn-primary {
  width: 100%;
}

/* --- Code Entry --- */
.code-entry {
  min-height: calc(100vh - 64px - 80px);
  display: flex;
  align-items: center;
  padding: var(--space-12) 0;
}

.code-entry .container {
  max-width: 480px;
  text-align: center;
}

.code-entry h1 {
  margin-bottom: var(--space-8);
}

.code-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.input-field {
  width: 100%;
  padding: 1rem var(--space-5);
  font-size: var(--text-lg);
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text);
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-field::placeholder {
  color: var(--text-muted);
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(13, 107, 79, 0.1);
}

.input-field.error {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
  animation: shake 0.5s var(--ease);
}

.error-message {
  color: var(--error);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--error-bg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
}

.hint-text {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* --- Redirect / Success --- */
.redirect {
  min-height: calc(100vh - 64px - 80px);
  display: flex;
  align-items: center;
  padding: var(--space-12) 0;
}

.redirect .container {
  max-width: 480px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  animation: scaleIn 0.5s var(--ease-spring);
}

.success-icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--success);
  stroke-width: 2.5;
  fill: none;
}

.redirect h1 {
  margin-bottom: var(--space-3);
}

.redirect .subtitle {
  margin-bottom: var(--space-8);
}

.redirect-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.copy-feedback {
  color: var(--success);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--space-2);
  animation: fadeIn 0.3s var(--ease);
}

/* --- Footer --- */
.footer {
  padding: var(--space-8) 0;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  border-top: 1px solid var(--card-border);
}

/* --- Loading spinner --- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-6px); }
  30%, 70% { transform: translateX(6px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Staggered entrance */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s var(--ease-out) forwards;
}

.fade-in-1 { animation-delay: 0.1s; }
.fade-in-2 { animation-delay: 0.2s; }
.fade-in-3 { animation-delay: 0.3s; }
.fade-in-4 { animation-delay: 0.4s; }

/* --- Responsive --- */
@media (min-width: 640px) {
  .trust-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .btn-primary,
  .btn-secondary {
    width: auto;
  }

  .package-card .btn-primary {
    width: 100%;
  }

  .redirect-actions {
    flex-direction: row;
    justify-content: center;
  }

  .redirect-actions .btn-primary,
  .redirect-actions .btn-secondary {
    width: auto;
    flex: 1;
    max-width: 220px;
  }
}

@media (min-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .subtitle { font-size: var(--text-xl); }

  .container { padding: 0 var(--space-8); }
  .section { padding: var(--space-20) 0; }

  .hero { padding: var(--space-16) 0 var(--space-20); }

  .package-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }

  .header-inner { height: 72px; }
  .logo { height: 40px; }
}

@media (min-width: 1024px) {
  h1 { font-size: var(--text-4xl); }

  .hero { padding: var(--space-20) 0 var(--space-24); }

  .video-container { max-width: 720px; }

  .play-button {
    width: 80px;
    height: 80px;
  }

  .play-button::after {
    border-width: 13px 0 13px 22px;
    margin-left: 4px;
  }
}
