/* ============================================
   AlignCam — 2026 Dark Glass Design System
   Palette: Dark + Emerald Glow + Gold Accent
   Style: Premium Dark UI / Glassmorphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap');

/* ── CSS Variables — Dark Mode 2026 ── */
:root {
  /* Dark Backgrounds */
  --bg-deep: #041715;
  --bg-primary: #082422;
  --bg-secondary: rgba(255, 255, 255, 0.04);
  --bg-tertiary: rgba(255, 255, 255, 0.06);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-hover: rgba(255, 255, 255, 0.12);

  /* Emerald — Primary */
  --primary: #19b893;
  --primary-dark: #0ca57f;
  --primary-light: #59f8d3;
  --primary-glow: rgba(25, 184, 147, 0.18);
  --primary-glow-strong: rgba(25, 184, 147, 0.3);
  --primary-surface: rgba(25, 184, 147, 0.1);

  /* Gold — Accent */
  --gold: #f4af2e;
  --gold-dark: #cf8f17;
  --gold-light: #ffd179;
  --gold-glow: rgba(244, 175, 46, 0.16);
  --gold-glow-strong: rgba(244, 175, 46, 0.28);
  --gold-surface: rgba(244, 175, 46, 0.08);

  /* Secondary */
  --secondary: #06B6D4;
  --secondary-dark: #0891B2;
  --secondary-glow: rgba(6, 182, 212, 0.1);

  /* Status */
  --success: #34D399;
  --warning: #FBBF24;
  --danger: #EF4444;
  --info: #06B6D4;

  /* Text — Light on Dark */
  --text: #e8f8f4;
  --text-secondary: rgba(232, 248, 244, 0.72);
  --text-muted: rgba(201, 221, 215, 0.62);
  --text-inverse: #050505;

  /* Borders — Glass */
  --border: rgba(232, 248, 244, 0.1);
  --border-light: rgba(232, 248, 244, 0.14);
  --border-medium: rgba(232, 248, 244, 0.2);
  --border-primary: rgba(25, 184, 147, 0.32);
  --border-gold: rgba(244, 175, 46, 0.28);

  /* Shadows — Glow based */
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 54px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 34px 78px rgba(0, 0, 0, 0.46);
  --shadow-glow: 0 4px 24px var(--primary-glow);
  --shadow-gold: 0 4px 24px var(--gold-glow);

  /* Gradient */
  --accent-gradient: linear-gradient(135deg, #19b893 0%, #44e8c2 58%, #f4af2e 100%);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radius */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-2xl: 36px;
  --radius-full: 9999px;

  /* Typography */
  --font-display: 'Sora', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.5rem;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
  --duration-slow: 400ms;
  --duration-slower: 600ms;

  /* Z-index */
  --z-base: 1;
  --z-sticky: 5;
  --z-overlay: 10;
  --z-modal: 100;
  --z-toast: 1000;
}


/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 18% -12%, rgba(25, 184, 147, 0.32) 0%, transparent 34%),
    radial-gradient(circle at 90% -18%, rgba(244, 175, 46, 0.24) 0%, transparent 28%),
    linear-gradient(180deg, var(--bg-deep), var(--bg-primary) 40%, var(--bg-deep));
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.8), transparent 86%);
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--primary-light);
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
  user-select: none;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}


/* ── Utilities ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gold {
  color: var(--gold);
}

.text-emerald {
  color: var(--primary);
}

.font-display {
  font-family: var(--font-display);
}

.fade-in {
  animation: fadeIn var(--duration-slow) var(--ease) forwards;
}

.slide-up {
  animation: slideUp var(--duration-slower) var(--ease-out) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -40px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 30px) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.015em;
  transition: all var(--duration) var(--ease);
  min-height: 48px;
  min-width: 48px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 65%, var(--primary-light));
  color: #063a31;
  box-shadow: 0 8px 20px var(--primary-glow-strong), var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: 0 0 40px var(--primary-glow-strong), 0 14px 28px rgba(0, 0, 0, 0.34);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  box-shadow: 0 0 20px var(--gold-glow);
}

.btn-gold:hover {
  box-shadow: 0 0 40px var(--gold-glow-strong);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  border-color: rgba(52, 211, 153, 0.7);
  color: var(--text);
  box-shadow: 0 0 20px var(--primary-glow), inset 0 0 0 1px rgba(52, 211, 153, 0.24);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-lg {
  padding: 16px 40px;
  font-size: var(--text-base);
  min-height: 56px;
  letter-spacing: 0.03em;
}

.btn-sm {
  padding: 8px 18px;
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-full {
  width: 100%;
}

.btn svg,
.btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* ── Cards — Glass ── */
.card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--duration-slow) var(--ease);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 30px var(--primary-glow);
  border-color: var(--border-primary);
}

.card-gold {
  border-color: var(--border-gold);
}

.card-gold:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 24px var(--gold-glow);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}


/* ── Form Elements — Glass ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-base);
  transition: all var(--duration) var(--ease);
  min-height: 48px;
  backdrop-filter: blur(8px);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16), 0 0 24px var(--primary-glow);
  background: rgba(255, 255, 255, 0.08);
}

.form-input:hover:not(:focus) {
  border-color: var(--border-medium);
}

select.form-input {
  appearance: auto;
}

select.form-input option {
  background-color: var(--bg-primary);
  color: var(--text);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}


/* ── Range Slider ── */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 12px var(--primary-glow);
  cursor: pointer;
  transition: transform var(--duration) var(--ease);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  cursor: pointer;
}


/* ── Toggle Switch ── */
.toggle {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--duration) var(--ease);
}

.toggle input:checked+.toggle-slider {
  background: var(--primary);
  border-color: var(--primary-dark);
  box-shadow: 0 0 16px var(--primary-glow);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(24px);
  background: white;
}


/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--primary-surface);
  color: var(--primary);
  letter-spacing: 0.02em;
  border: 1px solid var(--border-primary);
}

.badge-gold {
  background: var(--gold-surface);
  color: var(--gold);
  border-color: var(--border-gold);
}


/* ── Modal — Glass ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration) var(--ease);
  padding: var(--space-lg);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ac-modal {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  transform: scale(0.95) translateY(16px);
  transition: transform var(--duration) var(--ease-bounce);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 60px var(--primary-glow);
  backdrop-filter: blur(20px);
}

.modal-overlay.active .ac-modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface);
  color: var(--text);
}

.modal-body {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--border);
  margin-top: var(--space-sm);
}


/* ── Toast — Glass ── */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transform: translateX(120%);
  transition: transform var(--duration-slow) var(--ease-bounce);
  min-width: 300px;
  max-width: 420px;
  backdrop-filter: blur(20px);
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--gold);
}

.toast-message {
  flex: 1;
  font-size: var(--text-sm);
}


/* ── Loading ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--bg-tertiary) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}


/* ═══════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════ */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  z-index: 1;
}

.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px 260px at 12% -8%, rgba(25, 184, 147, 0.14), transparent 68%),
    radial-gradient(560px 240px at 86% -10%, rgba(244, 175, 46, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 24px));
  margin: 12px auto 0;
  padding: 10px 14px;
  background: rgba(5, 22, 20, 0.68);
  backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  position: sticky;
  top: 12px;
  z-index: var(--z-sticky);
}

.page-header,
.page-content {
  position: relative;
  z-index: 1;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-content {
  flex: 1;
  padding: calc(var(--space-xl) + 8px) var(--space-lg);
  width: min(1240px, 100%);
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
}

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--primary);
}


/* ═══════════════════════════════════════════
   LOGIN PAGE — Glass
   ═══════════════════════════════════════════ */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-glow-strong) 0%, transparent 70%);
  top: -150px;
  right: -150px;
  filter: blur(60px);
  animation: orbFloat 20s ease-in-out infinite;
}

.login-bg::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  filter: blur(60px);
  animation: orbFloat 25s ease-in-out infinite reverse;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-2xl);
  position: relative;
  z-index: 2;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 60px var(--primary-glow);
  backdrop-filter: blur(20px) saturate(180%);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-md);
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 0 40px var(--primary-glow);
  color: white;
}

.login-logo h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-logo p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--duration) var(--ease);
  min-height: 52px;
  cursor: pointer;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.social-btn svg,
.social-btn img {
  width: 20px;
  height: 20px;
}

.btn-google {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border-medium);
}

.btn-google:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-apple {
  background: rgba(255, 255, 255, 0.9);
  color: #0A0A0A;
}

.btn-apple:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.login-toggle {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.login-toggle a {
  color: var(--primary);
  font-weight: 600;
}


/* ═══════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════ */
.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-inverse);
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 16px var(--primary-glow);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.greeting {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.greeting-sub {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.project-card-cover {
  width: 100%;
  height: 210px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  overflow: hidden;
  position: relative;
}

.project-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease);
}

.project-card:hover .project-card-cover img {
  transform: scale(1.06);
}

.project-card-cover .placeholder-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 48px;
}

.project-card-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: 4px;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

.project-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.new-project-card {
  border: 2px dashed var(--border-medium);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  min-height: 300px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  background: transparent;
  box-shadow: none;
}

.new-project-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
  box-shadow: 0 0 40px var(--primary-glow);
}

.new-project-card svg {
  width: 40px;
  height: 40px;
}


/* ═══════════════════════════════════════════
   PROJECT DETAIL
   ═══════════════════════════════════════════ */
.project-detail {
  padding-bottom: 100px;
}

.angles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.angle-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  cursor: pointer;
  border-radius: var(--radius-md);
}

.angle-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  background: var(--primary-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all var(--duration) var(--ease);
}

.angle-card:hover .angle-icon {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--primary-glow);
}

.angle-name {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 2px;
  color: var(--text);
}

.angle-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}


/* ── Timeline ── */
.timeline {
  margin-top: var(--space-2xl);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
}

.timeline-item {
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.timeline-item:hover {
  transform: translateY(-4px);
}

.timeline-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  margin-bottom: var(--space-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.timeline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease);
}

.timeline-item:hover .timeline-thumb img {
  transform: scale(1.05);
}

.timeline-item:hover .timeline-thumb {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 24px var(--primary-glow);
}

.timeline-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-note {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ── Angle chips ── */
.angle-chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.angle-chip:hover {
  border-color: rgba(52, 211, 153, 0.55);
  color: var(--text);
}

.angle-chip.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 16px var(--primary-glow);
}


/* ═══════════════════════════════════════════
   CAMERA PAGE
   ═══════════════════════════════════════════ */
.camera-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #050505;
  position: relative;
  overflow: hidden;
}

.camera-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  z-index: var(--z-overlay);
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.7), transparent);
  padding-top: max(var(--space-md), env(safe-area-inset-top));
}

.camera-viewport {
  flex: 1;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

#cameraVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: transparent;
}

#overlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 2;
}

#guideCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.camera-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg) var(--space-xl);
  padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5, 5, 5, 0.8), transparent);
  z-index: var(--z-overlay);
}

.camera-controls-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.opacity-control {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 300px;
}

.opacity-control .range-slider {
  background: rgba(255, 255, 255, 0.15);
}

.opacity-control .range-slider::-webkit-slider-thumb {
  background: var(--gold);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 16px var(--gold-glow);
}

.opacity-label {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  min-width: 36px;
  text-align: center;
}

.camera-controls-main {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.capture-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 4px solid var(--gold);
  position: relative;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  box-shadow: 0 0 24px var(--gold-glow);
}

.capture-btn::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: white;
  transition: all var(--duration) var(--ease);
}

.capture-btn:hover {
  transform: scale(1.05);
  border-color: var(--gold-light);
  box-shadow: 0 0 40px var(--gold-glow-strong);
}

.capture-btn:active::before {
  background: var(--primary);
}

.capture-btn.capturing {
  animation: captureFlash 0.3s ease;
}

@keyframes captureFlash {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.88);
  }

  100% {
    transform: scale(1);
  }
}

.camera-side-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-side-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.camera-side-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.camera-angle-selector {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-md);
  overflow-x: auto;
  padding: var(--space-xs) 0;
}

.camera-angle-selector .angle-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.camera-angle-selector .angle-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.camera-angle-selector .angle-chip.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #050505;
  box-shadow: 0 0 16px var(--gold-glow);
}

.alignment-status {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: var(--z-overlay);
  backdrop-filter: blur(12px);
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.02em;
}

.alignment-status.aligned {
  background: rgba(52, 211, 153, 0.15);
  color: #6EE7B7;
  border: 1px solid rgba(52, 211, 153, 0.25);
  box-shadow: 0 0 20px var(--primary-glow);
}

.alignment-status.misaligned {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.alignment-status.no-face {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.camera-flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

.camera-flash.active {
  animation: flash 0.4s ease-out;
}

@keyframes flash {
  0% {
    opacity: 0.8;
  }

  100% {
    opacity: 0;
  }
}


/* ═══════════════════════════════════════════
   COMPARE PAGE
   ═══════════════════════════════════════════ */
.compare-page {
  padding-bottom: 80px;
}

.compare-mode-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: var(--space-xl);
}

.compare-tab {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  letter-spacing: 0.02em;
}

.compare-tab:hover {
  color: var(--text);
}

.compare-tab.active {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 16px var(--primary-glow);
}

.compare-slider-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
  aspect-ratio: 3/4;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.compare-image {
  position: absolute;
  inset: 0;
}

.compare-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-image-after {
  clip-path: inset(0 0 0 50%);
}

.compare-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  cursor: ew-resize;
  z-index: 5;
  transform: translateX(-50%);
}

.compare-slider-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: rgba(20, 20, 20, 0.9);
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--gold-glow);
}

.compare-slider-handle::after {
  content: '⟷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: var(--gold);
  z-index: 6;
}

.compare-label {
  position: absolute;
  bottom: var(--space-md);
  padding: 4px 14px;
  background: rgba(5, 5, 5, 0.7);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  z-index: 4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.compare-label-before {
  left: var(--space-md);
}

.compare-label-after {
  right: var(--space-md);
}

.compare-merge {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.compare-merge-side {
  flex: 1;
  position: relative;
  aspect-ratio: 3/4;
}

.compare-merge-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-merge-divider {
  width: 3px;
  background: var(--gold);
  position: relative;
  z-index: 2;
  box-shadow: 0 0 12px var(--gold-glow);
}

.photo-selector {
  margin-top: var(--space-xl);
}

.photo-selector-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.photo-selector-scroll {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding: var(--space-sm) 0;
}

.photo-selector-item {
  width: 80px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--duration) var(--ease);
}

.photo-selector-item:hover {
  border-color: var(--border-medium);
}

.photo-selector-item.selected {
  border-color: var(--gold);
  box-shadow: 0 0 16px var(--gold-glow-strong);
}

.photo-selector-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ═══════════════════════════════════════════
   EXPORT
   ═══════════════════════════════════════════ */
.export-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.export-option {
  padding: var(--space-lg);
  text-align: center;
}

.export-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--space-md);
  background: var(--primary-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all var(--duration) var(--ease);
}

.export-option:hover .export-icon {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 0 24px var(--primary-glow);
}

.export-name {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
}

.export-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--duration) var(--ease);
}


/* ═══════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  margin-bottom: var(--space-lg);
  background: var(--primary-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 320px;
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.photo-detail-image {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
}

.photo-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.photo-detail-meta-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.photo-detail-meta-item span:first-child {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
}

.card table th,
.card table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card table tbody tr {
  transition: background-color var(--duration-fast) var(--ease);
}

.card table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --space-lg: 16px;
    --space-xl: 24px;
  }

  .page-header {
    top: 8px;
    margin-top: 8px;
    width: calc(100% - 14px);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
  }

  .page-content {
    padding-top: var(--space-xl);
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .angles-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .compare-merge {
    flex-direction: column;
  }

  .export-options {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .camera-viewport {
    max-width: 800px;
    margin: 0 auto;
  }
}

@media (min-width: 768px) and (orientation: landscape) {
  .camera-controls {
    padding-bottom: var(--space-lg);
  }

  .camera-controls-main {
    max-width: 500px;
    margin: 0 auto;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .login-card {
    max-width: 460px;
  }

  .compare-slider-container {
    max-width: 500px;
  }
}

@supports (padding: env(safe-area-inset-top)) {
  .camera-header {
    padding-top: calc(var(--space-md) + env(safe-area-inset-top));
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

::selection {
  background: var(--primary-glow-strong);
  color: white;
}
