/* =========================================================
   StockNoter — Shared Design System (Light Theme)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── Tokens ── */
:root {
  /* Palette */
  --sn-green: #10b981;
  --sn-green-dark: #059669;
  --sn-green-light: #ecfdf5;
  --sn-blue: #2563eb;
  --sn-blue-mid: #3b82f6;
  --sn-blue-light: #eff6ff;
  --sn-orange: #f97316;
  --sn-orange-light: #fff5eb;

  /* Surface */
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;
  --border: rgba(148, 163, 184, 0.12);
  --border-focus: #2563eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,.05), 0 8px 16px -6px rgba(0,0,0,.03);
  --shadow-lg: 0 20px 50px -12px rgba(0,0,0,.08), 0 8px 24px -8px rgba(0,0,0,.04);
  --shadow-card: 0 10px 30px -10px rgba(148,163,184,0.08), 0 1px 2px rgba(148,163,184,0.03);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --grad-hero: radial-gradient(circle at 50% 0%, #eff6ff 0%, #f8fafc 100%);
  --grad-accent: linear-gradient(135deg, #10b981 0%, #2563eb 100%);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-layers */
  --z-nav: 1000;
  --z-modal: 2000;
  --z-toast: 3000;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--r-full); font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none;
  border: none; outline: none; transition: var(--transition); white-space: nowrap;
  position: relative; overflow: hidden;
}

.btn-primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 4px 16px rgba(34,197,94,.32);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34,197,94,.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #fff; color: var(--sn-blue);
  border: 1.5px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--sn-blue-light); border-color: var(--sn-blue-mid); }

.btn-outline {
  background: transparent; color: var(--sn-green-dark);
  border: 1.5px solid var(--sn-green);
}
.btn-outline:hover { background: var(--sn-green-light); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,.3);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(239,68,68,.45); }

.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }

.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── Logo ── */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { height: 40px; width: auto; }
.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem; font-weight: 700;
  background: var(--grad-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Navigation ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav);
  padding: 12px 0;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,.05);
  transition: var(--transition);
}
.site-nav.scrolled {
  padding: 8px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-links a {
  padding: 8px 14px; border-radius: var(--r-full);
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; transition: var(--transition);
}
.nav-links a:hover { color: var(--sn-blue); background: var(--sn-blue-light); }
.nav-links a.active { color: var(--sn-blue); background: var(--sn-blue-light); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 28px;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.875rem; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.form-input {
  width: 100%; padding: 12px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--bg-input);
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; color: var(--text-primary);
  outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.1); }

.form-hint { font-size: 0.8rem; color: var(--text-muted); }
.form-error { font-size: 0.8rem; color: #ef4444; display: none; }
.form-error.visible { display: block; }

/* ── Badge / Pill ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--r-full);
  font-size: 0.78rem; font-weight: 600; letter-spacing: .03em;
}
.badge-green { background: var(--sn-green-light); color: var(--sn-green-dark); }
.badge-blue { background: var(--sn-blue-light); color: var(--sn-blue); }
.badge-orange { background: var(--sn-orange-light); color: var(--sn-orange); }

/* ── Toast / Alert ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: var(--z-toast);
  max-width: 360px; padding: 14px 20px; border-radius: var(--r-md);
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  transform: translateY(100px); opacity: 0; transition: all .4s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast-success { border-left: 4px solid var(--sn-green); }
.toast-error { border-left: 4px solid #ef4444; }
.toast-info { border-left: 4px solid var(--sn-blue-mid); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.toast-msg { font-size: 0.83rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Alert box ── */
.alert {
  padding: 14px 18px; border-radius: var(--r-md);
  font-size: 0.9rem; display: none;
}
.alert.visible { display: flex; align-items: flex-start; gap: 10px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px; color: var(--text-muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Section ── */
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-full);
  background: var(--sn-green-light); color: var(--sn-green-dark);
  font-size: 0.8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.2;
  color: var(--text-primary); margin-bottom: 14px;
}
.section-sub {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 580px; margin: 0 auto;
}

/* ── Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border-color: rgba(59,130,246,.25);
  border-top-color: var(--sn-blue);
}

/* ── 3D Card tilt effect ── */
.tilt-card { perspective: 1200px; }
.tilt-inner {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
  border-radius: var(--r-lg);
}
.tilt-card:hover .tilt-inner { transform: rotateY(-6deg) rotateX(3deg); }

/* ── Glassmorphism light variant ── */
.glass {
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.9);
}

/* ── Gradient text ── */
.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.gradient-text-blue {
  background: var(--grad-blue);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Footer ── */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.87rem; color: var(--text-secondary); text-decoration: none;
  transition: color .2s;
}
.footer-links a:hover { color: var(--sn-blue); }
.footer-copy { font-size: 0.83rem; color: var(--text-muted); text-align: center; }

/* ── Page-level wrapper for auth pages ── */
.auth-page {
  min-height: 100vh; display: flex;
  background: var(--grad-hero);
}
.auth-left {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px; min-height: 100vh;
}
.auth-right {
  flex: 0 0 500px;
  background: #fff; padding: 60px 48px;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: -8px 0 32px rgba(0,0,0,.06);
  min-height: 100vh;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.anim-fade-up { animation: fadeUp .6s ease-out both; }
.anim-fade-up-d1 { animation-delay: .1s; }
.anim-fade-up-d2 { animation-delay: .2s; }
.anim-fade-up-d3 { animation-delay: .3s; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-right { flex: 0 0 100%; min-height: auto; padding: 40px 28px; }
  .auth-left { display: none; }
  .auth-page { flex-direction: column; }
}
@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .container { padding: 0 16px; }
  .auth-right { padding: 32px 20px; }
}
