/* ═══════════════════════════════════════════════════════════════
   条款通 (Terms Connect) — Premium Design System V33
   对齐 MC-Revolution v33 分支 · Apple-Inspired Precision Design
   Micro Connect 滴灌通 · Powered by Hono + Cloudflare Pages
   ═══════════════════════════════════════════════════════════════ */

/* ========== 1. 设计令牌系统 ========== */
:root {
  /* Contract Connect 品牌色彩系统 - Teal */
  --color-primary: #5DC4B3;
  --color-primary-light: #7DD4C7;
  --color-primary-dark: #3D8F83;
  --color-accent: #49A89A;
  --color-accent-cyan: #32ade6;
  --color-accent-emerald: #34c759;
  --color-accent-amber: #ff9f0a;
  --color-accent-rose: #ff375f;

  /* 向后兼容旧变量名 */
  --brand: #5DC4B3;
  --brand-light: #7DD4C7;
  --brand-dark: #3D8F83;
  --brand-accent: #49A89A;
  --logo-bright: #2EC4B6;
  --logo-bright2: #3DD8CA;
  --logo-dark: #28A696;
  --terms-light: #F0FDFA;
  --terms-dark: #5DC4B3;

  /* Semantic Colors */
  --info: #32ade6;
  --success: #34c759;
  --warning: #ff9f0a;
  --error: #ff375f;

  /* 渐变系统 - 精致柔和 */
  --gradient-primary: linear-gradient(135deg, #5DC4B3 0%, #49A89A 100%);
  --gradient-cyber: linear-gradient(135deg, #0a2e2a 0%, #0f3d36 50%, #164e47 100%);
  --gradient-neon: linear-gradient(135deg, #32ade6 0%, #5DC4B3 40%, #49A89A 70%, #3D8F83 100%);
  --gradient-aurora: linear-gradient(135deg, #0a2e2a 0%, #0f3d36 25%, #0c3530 50%, #164e47 75%, #1a6b5f 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
  --gradient-success: linear-gradient(135deg, #30b750 0%, #34c759 100%);
  --gradient-warning: linear-gradient(135deg, #f0840a 0%, #ff9f0a 100%);
  --gradient-danger: linear-gradient(135deg, #d62040 0%, #ff375f 100%);
  --gradient-info: linear-gradient(135deg, #0a84ff 0%, #32ade6 100%);
  --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8f9fe 100%);
  --gradient-mesh: radial-gradient(at 20% 20%, rgba(93, 196, 179, 0.06) 0%, transparent 50%),
                   radial-gradient(at 80% 80%, rgba(73, 168, 154, 0.04) 0%, transparent 50%),
                   radial-gradient(at 50% 50%, rgba(50, 173, 230, 0.03) 0%, transparent 50%);

  /* 玻璃态效果 - Apple风毛玻璃 */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-solid: rgba(255, 255, 255, 0.92);
  --glass-bg-dark: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-light: rgba(93, 196, 179, 0.15);
  --glass-blur: blur(24px) saturate(180%);

  /* Text Hierarchy */
  --text-primary: #1d1d1f;
  --text-title: #1a1a1a;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-placeholder: #aeaeb2;

  /* Surfaces */
  --surface-page: #f5f5f7;
  --surface-card: rgba(255, 255, 255, 0.88);
  --surface-navbar: rgba(255, 255, 255, 0.92);
  --surface-modal-footer: #f8fafc;
  --surface-divider: #f1f5f9;

  /* 精致阴影 - Apple风分层阴影 */
  --shadow-neon-primary: 0 0 24px rgba(93, 196, 179, 0.2), 0 0 48px rgba(93, 196, 179, 0.06);
  --shadow-neon-cyan: 0 0 24px rgba(50, 173, 230, 0.2), 0 0 48px rgba(50, 173, 230, 0.06);
  --shadow-neon-emerald: 0 0 24px rgba(52, 199, 89, 0.2), 0 0 48px rgba(52, 199, 89, 0.06);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.04), 0 16px 40px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.06), 0 24px 56px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 16px 32px rgba(0, 0, 0, 0.08), 0 32px 72px rgba(0, 0, 0, 0.14);
  --shadow-inner: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 1px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.05);
  --shadow-card-hover: 0 4px 8px rgba(0,0,0,0.04), 0 16px 48px rgba(93,196,179,0.1);

  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 9999px;

  /* 动画系统 - Apple风顺滑 */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-apple: cubic-bezier(0.28, 0.11, 0.32, 1);
  --duration-fast: 180ms;
  --duration-normal: 280ms;
  --duration-slow: 420ms;
  --transition-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-normal: 280ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Font Stacks */
  --font-body: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --font-brand: 'Montserrat', 'Inter', 'Futura', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ========== 2. 全局基础样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-page);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

/* ========== 3. 科技感背景系统 ========== */
.cyber-bg {
  position: relative;
  background: var(--gradient-aurora);
}
.cyber-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(93, 196, 179, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(73, 168, 154, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(50, 173, 230, 0.12) 0%, transparent 50%);
  pointer-events: none;
}

.grid-bg {
  background-color: #f5f5f7;
  background-image:
    var(--gradient-mesh),
    linear-gradient(rgba(93, 196, 179, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 196, 179, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

.particles-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(93, 196, 179, 0.5) 0, transparent 2px),
    radial-gradient(circle at 40% 70%, rgba(73, 168, 154, 0.4) 0, transparent 2px),
    radial-gradient(circle at 60% 20%, rgba(50, 173, 230, 0.35) 0, transparent 2px),
    radial-gradient(circle at 80% 60%, rgba(52, 199, 89, 0.3) 0, transparent 2px),
    radial-gradient(circle at 10% 80%, rgba(255, 55, 95, 0.25) 0, transparent 2px),
    radial-gradient(circle at 90% 40%, rgba(93, 196, 179, 0.35) 0, transparent 2px);
  pointer-events: none;
  animation: particleFloat 30s linear infinite;
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-16px); opacity: 0.85; }
}

/* ========== 4. Tailwind Extensions ========== */
.bg-page { background-color: var(--surface-page); }
.bg-card { background: var(--surface-card); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-brand { color: var(--brand); }
.text-terms { color: var(--terms-dark); }
.bg-brand { background-color: var(--brand); }
.bg-terms { background-color: var(--terms-dark); }
.bg-terms-light { background-color: var(--terms-light); }
.text-neon { background: var(--gradient-neon); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-gradient { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ========== 5. Loading Screen - V33 开屏动画 ========== */
#app-loading {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a2e2a 0%, #0f3d36 25%, #0c3530 50%, #164e47 75%, #1a6b5f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#app-loading.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#app-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(46, 196, 182, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(40, 166, 150, 0.2) 0%, transparent 50%);
}

/* Dual-circle animated logo */
.loading-logo {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}
.loading-logo-ring {
  position: absolute;
  inset: 0;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-radius: 50%;
}
.loading-logo-ring-inner {
  position: absolute;
  inset: 10px;
  border: 2.5px solid rgba(93, 196, 179, 0.3);
  border-radius: 50%;
  border-top-color: #5DC4B3;
  animation: spin 1.2s linear infinite;
}
.loading-logo-ring-outer {
  position: absolute;
  inset: 0;
  border: 2.5px solid rgba(93, 196, 179, 0.15);
  border-radius: 50%;
  border-top-color: rgba(93, 196, 179, 0.6);
  animation: spin 2s linear infinite reverse;
}
.loading-logo-center {
  position: absolute;
  inset: 20px;
  background: rgba(93, 196, 179, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  animation: pulse-logo 2s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-logo {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.loading-text {
  color: white;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}
.loading-sub {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Loading progress bar */
.loading-progress {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin-top: 24px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #5DC4B3, #7DD4C7);
  border-radius: 3px;
  animation: progress-fill 2s ease-in-out forwards;
}
@keyframes progress-fill {
  0% { width: 0%; }
  30% { width: 40%; }
  60% { width: 70%; }
  90% { width: 90%; }
  100% { width: 100%; }
}

.loading-powered {
  position: absolute;
  bottom: 32px;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ========== 6. Navbar - Apple风精致玻璃态 ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--glass-bg-solid);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.04);
  z-index: 100;
  transition: all var(--duration-normal) var(--ease-apple);
}
.navbar.scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}
.navbar:hover {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}
.navbar-brand-logo {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-brand-logo span {
  -webkit-text-fill-color: initial;
  color: var(--text-primary);
}
.navbar-brand-divider {
  width: 1px;
  height: 20px;
  background: rgba(0,0,0,0.1);
}
.navbar-product {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-product-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(93, 196, 179, 0.25);
}
.navbar-product-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  background: transparent;
  color: var(--text-secondary);
}
.navbar-btn:hover {
  background: rgba(93, 196, 179, 0.06);
  color: var(--color-primary);
}
.lang-toggle {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid rgba(0,0,0,0.08);
  background: white;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
}
.lang-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ========== 7. Button System - Apple精致风 ========== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-apple);
  overflow: hidden;
  letter-spacing: -0.01em;
  outline: none;
  text-decoration: none;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-normal);
}
.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04), 0 4px 12px rgba(93, 196, 179, 0.28), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 8px 24px rgba(93, 196, 179, 0.35);
  filter: brightness(1.06);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.96);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.btn-secondary:hover {
  border-color: rgba(93, 196, 179, 0.4);
  color: var(--color-primary);
  background: rgba(93, 196, 179, 0.04);
  box-shadow: 0 2px 8px rgba(93, 196, 179, 0.1);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.28);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(52, 199, 89, 0.35);
  filter: brightness(1.06);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 55, 95, 0.28);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 55, 95, 0.35);
  filter: brightness(1.06);
}

.btn-brand {
  background: var(--gradient-primary);
  color: white;
}
.btn-brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(93,196,179,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(93, 196, 179, 0.06);
  color: var(--color-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}
.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== 8. Card System - Apple精致玻璃态 ========== */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-apple);
  overflow: hidden;
  will-change: transform, box-shadow;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-neon);
  opacity: 0;
  transition: opacity var(--duration-normal);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(93, 196, 179, 0.12);
}
.card:hover::before {
  opacity: 1;
}

.card-static {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 0.5px solid rgba(0,0,0,0.04);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* ========== 9. Badge System ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-negotiating {
  background: linear-gradient(135deg, rgba(93, 196, 179, 0.15), rgba(73, 168, 154, 0.15));
  color: var(--color-primary);
}
.badge-agreed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.badge-rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.badge-expired {
  background: var(--surface-page);
  color: var(--text-tertiary);
}
.badge-glow {
  box-shadow: 0 2px 8px currentColor;
}

/* ========== 10. Three-Linked Slider System ========== */
.slider-container {
  padding: 8px 0;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.slider-label-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.slider-label-icon {
  font-size: 16px;
  color: var(--color-primary);
}
.slider-value {
  font-family: var(--font-brand);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.slider-value-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 4px;
}
.slider-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}
.slider-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 60ms ease;
  position: absolute;
  top: 0;
  left: 0;
}
.slider-thumb {
  width: 24px;
  height: 24px;
  background: white;
  border: 3px solid var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), var(--shadow-neon-primary);
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.slider-thumb:hover {
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 4px 12px rgba(93,196,179,0.3);
}
.slider-thumb:active {
  cursor: grabbing;
  transform: translateY(-50%) scale(1.1);
  animation: pulse-glow 1s ease infinite;
}
.slider-range {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-placeholder);
}

/* ========== 11. Metrics Panel ========== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}
.metric-card {
  background: var(--surface-page);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: all var(--transition-normal);
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.metric-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric-value {
  font-family: var(--font-brand);
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.metric-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.metric-value span {
  display: inline-block;
  transition: all 0.3s var(--ease-apple);
}

/* ========== 12. Timeline ========== */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent), var(--surface-divider));
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
  animation: fadeInUp 0.4s var(--ease-apple);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--color-primary);
  z-index: 1;
}
.timeline-item:first-child .timeline-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-neon-primary);
}
.timeline-content {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 0.5px solid rgba(0,0,0,0.06);
  transition: all var(--transition-fast);
}
.timeline-content:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}
.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.timeline-round {
  font-weight: 700;
  color: var(--color-primary);
}
.timeline-role { color: var(--text-tertiary); }
.timeline-time { color: var(--text-placeholder); margin-left: auto; }
.timeline-data {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.timeline-note {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--surface-page);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(93, 196, 179, 0.3);
}

/* Timeline per-proposal actions */
.tl-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.04);
  transition: opacity 0.2s ease;
}
.tl-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e5e7eb;
  background: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}
.tl-btn:hover { border-color: #d1d5db; background: #f9fafb; }
.tl-btn-accept:hover { border-color: var(--color-success); color: var(--color-success); background: rgba(16,185,129,0.04); }
.tl-btn-reject:hover { border-color: var(--color-error); color: var(--color-error); background: rgba(239,68,68,0.04); }
.tl-btn-counter:hover { border-color: var(--terms-dark); color: var(--terms-dark); background: var(--terms-light); }

/* Timeline status badges on proposals */
.tl-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}
.tl-status-agreed {
  background: rgba(16,185,129,0.1);
  color: #059669;
}
.tl-status-rejected {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
}

@media (max-width: 480px) {
  .tl-actions { flex-wrap: wrap; }
  .tl-btn { font-size: 11px; padding: 4px 8px; }
}

/* ========== 13. Hero Section ========== */
.hero {
  padding-top: 96px;
  padding-bottom: 48px;
  text-align: center;
}
.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  margin: 0 auto 20px;
  box-shadow: var(--shadow-md), var(--shadow-neon-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-title {
  font-family: var(--font-body);
  font-size: 42px;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.15;
}
.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 400;
}
.hero-metaphor {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}

/* ========== 14. Formula Card ========== */
.formula-card {
  background: linear-gradient(135deg, rgba(240,253,250,0.5), rgba(93,196,179,0.08));
  border: 1px solid rgba(93,196,179,0.12);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  text-align: center;
  backdrop-filter: blur(12px);
}
.formula-expression {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.formula-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-tertiary);
}
.formula-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.formula-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* ========== 15. Footer ========== */
.footer {
  background: radial-gradient(ellipse 130% 90% at 50% 20%, #0f3d36 0%, #0b312c 40%, #082420 70%, #061b18 100%);
  color: rgba(255,255,255,0.7);
  padding: 60px 24px 40px;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(93,196,179,0.3), transparent);
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-logo {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 18px;
  color: white;
}
.footer-logo span { color: var(--brand-light); }
.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  max-width: 280px;
  line-height: 1.5;
}
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-links-group h4 {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.footer-links-group a {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  text-decoration: none;
  padding: 3px 0;
  transition: color var(--transition-fast);
}
.footer-links-group a:hover { color: var(--brand-light); }
.footer-divider { height: 0.5px; background: rgba(255,255,255,0.08); margin-bottom: 24px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-aurora-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  margin-right: 6px;
  animation: aurora-pulse 3s ease-in-out infinite;
}
@keyframes aurora-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ========== 16. Toast Notification ========== */
.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  border: 0.5px solid rgba(0,0,0,0.06);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-success { border-left: 4px solid var(--success); color: var(--success); }
.toast-error { border-left: 4px solid var(--error); color: var(--error); }
.toast-info { border-left: 4px solid var(--color-primary); color: var(--color-primary); }

/* ========== 17. Section & Form Styles ========== */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.section-title i { color: var(--color-primary); margin-right: 8px; }

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: white;
  transition: all var(--duration-fast) var(--ease-apple);
  outline: none;
}
.input-field:hover { border-color: rgba(0, 0, 0, 0.2); }
.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(93, 196, 179, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.input-field::placeholder { color: var(--text-placeholder); }
.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ========== 18. Comparison Table ========== */
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table thead th {
  background: linear-gradient(135deg, rgba(93,196,179,0.08), rgba(73,168,154,0.08));
  color: var(--color-primary);
  padding: 12px 16px;
  font-weight: 600;
  text-align: center;
  border-bottom: 2px solid rgba(93,196,179,0.15);
}
.compare-table thead th:first-child { text-align: left; border-radius: var(--radius-sm) 0 0 0; }
.compare-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.compare-table tbody td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--surface-divider);
  color: var(--text-secondary);
}
.compare-table tbody td:first-child { text-align: left; font-weight: 500; color: var(--text-primary); }
.compare-table tbody tr:hover { background: rgba(93,196,179,0.03); }

/* ========== 19. Breadcrumb ========== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 16px 0;
}
.breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ========== 20. Tab Switcher ========== */
.tab-group {
  display: inline-flex;
  background: var(--surface-page);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 2px;
}
.tab-item {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active {
  background: white;
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

/* ========== 21. Scroll Reveal Animation ========== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-apple), transform 0.6s var(--ease-apple);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 22. Keyframe Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(93,196,179,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(93,196,179,0); }
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn var(--duration-normal) var(--ease-smooth); }
.animate-slide-up { animation: slideUp var(--duration-normal) var(--ease-smooth); }
.animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-spring); }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.shimmer {
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ========== 23. Responsive ========== */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; }
  .hero-title { font-size: 30px; }
  .hero-subtitle { font-size: 15px; }
  .slider-value { font-size: 20px; }
  .metric-value { font-size: 18px; }
  .footer-top { flex-direction: column; }
  .footer-links { gap: 32px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .formula-legend { flex-direction: column; align-items: center; gap: 8px; }
}

/* ========== 24. Misc & Utility ========== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

::selection { background: rgba(93,196,179,0.15); color: var(--text-primary); }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent; }

/* Back button */
.back-btn { transition: all 0.2s; }
.back-btn:hover { transform: translateX(-4px); background: #F0FDFA; }

/* ========== 24.5. Auth Overlay - V33 Full-Screen Modal ========== */

/* Full-screen overlay container */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.35s var(--ease-smooth);
}
.auth-overlay-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  /* Reinforced dark teal aurora background */
  background: linear-gradient(160deg, #051a18 0%, #0a2e2a 25%, #103d37 50%, #0a2e2a 75%, #051a18 100%);
}
.auth-overlay-bg::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background:
    radial-gradient(ellipse 600px 400px at 15% 20%, rgba(46,196,182,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 80% 30%, rgba(61,216,202,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 70%, rgba(40,166,150,0.1) 0%, transparent 70%);
  animation: auroraShift 12s ease-in-out infinite alternate;
}
@keyframes auroraShift {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}
/* Floating particles on overlay */
.auth-overlay-bg::after {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background-image:
    radial-gradient(2px 2px at 12% 25%, rgba(46,196,182,0.4) 0%, transparent 100%),
    radial-gradient(2px 2px at 38% 60%, rgba(61,216,202,0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 55% 18%, rgba(93,196,179,0.35) 0%, transparent 100%),
    radial-gradient(2px 2px at 72% 45%, rgba(46,196,182,0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 87% 75%, rgba(61,216,202,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 25% 82%, rgba(40,166,150,0.3) 0%, transparent 100%);
  animation: particleFloat 30s infinite linear;
}
.auth-overlay-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 24px 20px 40px;
}
/* Use margin:auto trick to center card vertically
   when content is short, but allow scrolling when tall */
.auth-overlay-center > .auth-card {
  margin-top: auto;
  margin-bottom: auto;
}
.auth-overlay-center > .auth-page-footer {
  margin-top: 0;
  flex-shrink: 0;
}
/* Scale-in animation for card entrance */
@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.92) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
/* Auth overlay toast notifications */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  font-size: 14px;
  font-weight: 500;
  color: #333;
  pointer-events: none;
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.4s var(--ease-apple);
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.toast-success { border-left: 4px solid #10b981; color: #065f46; }
.toast-error { border-left: 4px solid #ef4444; color: #991b1b; }
.toast-info { border-left: 4px solid #3b82f6; color: #1e40af; }
.toast-warning { border-left: 4px solid #f59e0b; color: #92400e; }

/* ========== 25. Auth Page - V33 White Card on Dark Aurora ========== */

/* Auth Card: white, centered, dramatic shadow */
.auth-card {
  background: white;
  border-radius: var(--radius-2xl);
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.08);
}

/* Logo Section */
.auth-logo-section {
  padding: 32px 32px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.auth-logo-circles {
  width: 52px;
  height: 68px;
  position: relative;
  margin: 0 auto 16px;
}
.auth-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: absolute;
  left: 4px;
}
.auth-circle-top {
  top: 0;
  background: linear-gradient(135deg, #2EC4B6 0%, #3DD8CA 100%);
  box-shadow: 0 4px 16px rgba(46,196,182,0.35);
}
.auth-circle-bottom {
  bottom: 0;
  background: linear-gradient(135deg, #28A696 0%, #2EC4B6 100%);
  box-shadow: 0 4px 16px rgba(40,166,150,0.3);
  opacity: 0.85;
}
.auth-brand-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  line-height: 1.15;
  margin-bottom: 6px;
}
.auth-brand-line {
  width: 120px;
  height: 2.5px;
  background: #2EC4B6;
  margin: 8px auto 10px;
  border-radius: 2px;
}
.auth-brand-powered {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: #666;
  font-weight: 500;
}
.auth-brand-cn {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 12px;
}

/* Tab Switcher */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.auth-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}
.auth-tab:hover {
  color: var(--text-secondary);
}
.auth-tab-active {
  color: #2EC4B6 !important;
  border-bottom-color: #2EC4B6 !important;
}

/* Form Wrap */
.auth-form-wrap {
  padding: 24px;
}
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.auth-required {
  color: #ef4444;
}
.auth-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: white;
  outline: none;
  transition: all var(--duration-fast) var(--ease-apple);
}
.auth-input::placeholder { color: #9ca3af; }
.auth-input:hover { border-color: #d1d5db; }
.auth-input:focus {
  border-color: #2EC4B6;
  box-shadow: 0 0 0 3px rgba(46,196,182,0.12);
}

/* Grid layouts */
.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Remember me & forgot password */
.auth-row {
  display: flex;
  align-items: center;
  font-size: 13px;
}
.auth-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.auth-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: #2EC4B6;
}
.auth-link {
  color: #2EC4B6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.auth-link:hover { color: #28A696; }

/* Password visibility toggle */
.password-wrapper {
  position: relative;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  border: none;
  padding: 0;
}
.password-toggle:hover {
  color: #475569;
  background: #f1f5f9;
}

/* Primary auth button */
.auth-btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--gradient-primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(93,196,179,0.28), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all var(--transition-normal);
  position: relative;
}
.auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(93,196,179,0.35);
  filter: brightness(1.04);
}
.auth-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Guest button */
.auth-btn-guest {
  width: 100%;
  padding: 12px 24px;
  background: white;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}
.auth-btn-guest:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* SSO Section */
.auth-sso-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}
.auth-sso-label {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 10px;
}
.auth-btn-sso {
  width: 100%;
  padding: 12px 24px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}
.auth-btn-sso:hover {
  background: #e5e7eb;
}

/* Role selector grid */
.auth-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.auth-role-btn {
  padding: 8px 10px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: white;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.auth-role-btn:hover {
  border-color: #d1d5db;
}
.auth-role-active {
  border-color: #2EC4B6 !important;
  background: rgba(46,196,182,0.06) !important;
  color: var(--text-primary);
}

/* Form error */
.form-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin-top: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  color: #dc2626;
  font-size: 13px;
  animation: shakeX 0.4s ease-in-out;
}
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.7s linear infinite;
  left: 50%;
  top: 50%;
  margin-left: -10px;
  margin-top: -10px;
}

/* Page footer */
.auth-page-footer {
  text-align: center;
  font-size: 13px;
  padding: 16px;
  color: rgba(255,255,255,0.35);
  position: relative;
  z-index: 1;
}

/* Float animation for logo */
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-spring); }

/* ========== 26. Invite Modal & Share ========== */

/* Modal overlay */
.invite-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.25s ease;
}
.invite-modal {
  background: white;
  border-radius: var(--radius-2xl);
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: scaleIn 0.3s var(--ease-spring);
}
.invite-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.invite-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-title);
  margin: 0;
}
.invite-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.invite-modal-close:hover { background: #f1f5f9; color: var(--text-primary); }
.invite-modal-body {
  padding: 24px;
}
.invite-modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.invite-form-field {
  margin-bottom: 16px;
}

/* Invite role buttons */
.invite-role-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.invite-role-btn:hover { border-color: #d1d5db; }
.invite-role-active {
  border-color: #2EC4B6 !important;
  background: rgba(46,196,182,0.06) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
}

/* QR code section */
.invite-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 16px;
}
.invite-qr-box {
  width: 200px;
  height: 200px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.invite-qr-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Link copy row */
.invite-link-section {
  margin-top: 16px;
}
.invite-link-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.invite-link-row .auth-input {
  flex: 1;
  min-width: 0;
}
.invite-copy-btn {
  flex-shrink: 0;
  padding: 10px 14px !important;
}
.invite-info-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-placeholder);
}
.invite-info-row span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========== 27. Invite Landing Page ========== */
.invite-landing-header {
  background: linear-gradient(135deg, #0a2e2a 0%, #1a6b5f 100%);
  padding: 32px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.invite-landing-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 300px 200px at 20% 40%, rgba(46,196,182,0.2) 0%, transparent 70%),
    radial-gradient(ellipse 250px 180px at 80% 60%, rgba(61,216,202,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.invite-landing-rings {
  width: 44px;
  height: 56px;
  position: relative;
  margin: 0 auto 14px;
  z-index: 1;
}
.invite-landing-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: white;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.invite-landing-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  position: relative;
  z-index: 1;
}
.invite-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.invite-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.invite-detail-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.invite-detail-label i { margin-right: 4px; }
.invite-detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-title);
}
.invite-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
}

/* Responsive */
@media (max-width: 480px) {
  .invite-modal { border-radius: var(--radius-xl); margin: 12px; }
  .invite-modal-body { padding: 18px; }
  .invite-qr-box { width: 160px; height: 160px; }
  .invite-detail-grid { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card { border-radius: var(--radius-xl); }
  .auth-logo-section { padding: 24px 20px 20px; }
  .auth-form-wrap { padding: 18px; }
  .auth-grid-2 { grid-template-columns: 1fr; }
  .auth-role-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .auth-brand-title { font-size: 20px; }
}
