@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Lexend:wght@400;500;600&family=Patrick+Hand&family=Quicksand:wght@400;500;600&display=swap');

/* ============================================
   Last Minute Lessons — Design System v1.0
   Base: warm neutrals + sun yellow accent (#f59e0b)
   Fonts: Inter (body) + Lexend (headings) + Patrick Hand (hero accents)
   ============================================ */

:root {
  /* Product Accent */
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fbbf24;
  --accent-bg: #fef3c7;
  --accent-bg-light: #fffbeb;

  /* Base Colors */
  --base-bg: #fafaf9;
  --base-surface: #ffffff;
  --base-text: #1c1917;
  --base-text-secondary: #78716c;
  --base-text-muted: #a8a29e;
  --base-border: #e7e5e4;
  --base-border-strong: #d6d3d1;

  /* Semantic */
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-accent: 'Patrick Hand', cursive;
  --font-fun: 'Patrick Hand', 'Quicksand', cursive;

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

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-accent: 0 4px 14px rgba(245, 158, 11, 0.25);
  --shadow-accent-hover: 0 6px 20px rgba(245, 158, 11, 0.35);
}

/* Base */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--base-text);
  background-color: var(--base-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--accent-dark); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--base-border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--base-text-secondary); }

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Typography */
.font-body { font-family: var(--font-body); }
.font-heading { font-family: var(--font-heading); }
.font-accent { font-family: var(--font-accent); }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: 1.2; }
.leading-snug { line-height: 1.4; }
.leading-normal { line-height: 1.6; }
.leading-relaxed { line-height: 1.8; }

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

/* Colors */
.text-base { color: var(--base-text); }
.text-secondary { color: var(--base-text-secondary); }
.text-muted { color: var(--base-text-muted); }
.text-accent { color: var(--accent); }
.text-white { color: #fff; }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.bg-base { background-color: var(--base-bg); }
.bg-surface { background-color: var(--base-surface); }
.bg-accent { background-color: var(--accent); }
.bg-accent-bg { background-color: var(--accent-bg); }
.bg-accent-bg-light { background-color: var(--accent-bg-light); }

/* Layout */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing */
.m-0 { margin: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }
.mb-20 { margin-bottom: var(--space-20); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-16 { margin-top: var(--space-16); }
.mt-20 { margin-top: var(--space-20); }

.ml-1 { margin-left: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.py-20 { padding-top: var(--space-20); padding-bottom: var(--space-20); }

/* Borders */
.border { border: 1px solid var(--base-border); }
.border-strong { border-color: var(--base-border-strong); }
.border-t { border-top: 1px solid var(--base-border); }
.border-t-strong { border-top: 1px solid var(--base-border-strong); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Position */
.relative { position: relative; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.-z-10 { z-index: -10; }
.z-50 { z-index: 50; }
.z-90 { z-index: 90; }

/* Effects */
.backdrop-blur { backdrop-filter: blur(12px); }
.pointer-events-none { pointer-events: none; }
.overflow-hidden { overflow: hidden; }
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }

/* ============================================
   COMPONENTS
   ============================================ */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 500;
  border-radius: var(--radius-full);
  padding: 12px 28px;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: var(--shadow-accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--base-text);
  border: 1.5px solid var(--base-border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--base-bg);
  border-color: var(--base-text-muted);
}

.btn-outline {
  background: white;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-outline:hover:not(:disabled) { background: var(--accent-bg-light); }

.btn-ghost {
  background: transparent;
  color: var(--base-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--base-border);
  color: var(--base-text);
}

.btn-sm { padding: 8px 20px; font-size: 0.875rem; }
.btn-lg { padding: 16px 40px; font-size: 1.125rem; }
.btn-full { width: 100%; }

/* Input */
.input {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-family: var(--font-body);
  border: 1.5px solid var(--base-border-strong);
  border-radius: var(--radius-full);
  background: var(--base-surface);
  color: var(--base-text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.input::placeholder { color: var(--base-text-muted); }

/* Card */
.card {
  background: var(--base-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--base-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Form label */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--base-text);
  margin-bottom: var(--space-2);
}

/* Status boxes */
.status-box {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--accent-bg-light);
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-bg);
}

.error-box {
  padding: var(--space-4) var(--space-6);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
  color: var(--error);
  font-size: 0.875rem;
}

/* Spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

/* Auth */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-10);
}

.auth-header { margin-bottom: var(--space-8); }
.auth-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--base-border);
}

/* Language toggle */
.lang-toggle {
  display: flex;
  gap: var(--space-1);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--base-border);
}

.lang-btn {
  font-size: 0.85rem;
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s;
  color: var(--base-text-secondary);
}

.lang-btn:hover { color: var(--base-text); }
.lang-btn.active {
  background: var(--accent);
  color: white;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 90;
  transition: all 0.3s ease;
  min-height: 8rem;
}

.site-header.nav-scrolled {
  min-height: auto;
  padding: var(--space-3) var(--space-6);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--base-border);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.brand img {
  height: 150px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.05));
  transition: height 0.3s ease;
}

.site-header.nav-scrolled .brand img { height: 50px; }

/* Main content */
.site-main {
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  width: 100%;
}

.site-main--narrow {
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  width: 100%;
}

/* Dashboard */
.dash-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.package-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
}

.download-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--base-border);
  transition: background 0.2s;
  margin-bottom: var(--space-3);
  font-size: 0.875rem;
  color: var(--base-text);
  text-decoration: none;
}

.download-link:hover { background: var(--base-bg); }

/* Feature icon circle */
.feature-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--accent-bg);
  border-radius: 50%;
  margin: var(--space-6) auto var(--space-6);
}

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

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Stripe Elements */
.StripeElement {
  padding: 14px 20px;
  border: 1.5px solid var(--base-border-strong);
  border-radius: var(--radius-full);
  background: var(--base-surface);
  transition: all 0.2s ease;
}

.StripeElement--focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.StripeElement--invalid { border-color: var(--error); }

/* Responsive */
@media (max-width: 640px) {
  .site-header { padding: var(--space-3) var(--space-4); min-height: auto; }
  .brand img { height: 80px !important; }
  .site-main, .site-main--narrow { padding: var(--space-8) var(--space-4); }
  .auth-wrapper { padding: var(--space-4); }
  .auth-card { padding: var(--space-6); }
}
