/* ===================================================================
   车辆维修管理系统 — Slate Modern Pro Design System v3.0
   设计理念：简洁专业 · 清晰易读 · 现代质感
   =================================================================== */

/* ===== CSS Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  /* 移动端禁用双指缩放 + 双击放大（刘赛博要求）：
     touch-action: manipulation 会让浏览器只处理单指滚动/点击，
     忽略双指手势与 300ms 点击延迟的双击放大
  */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Design Tokens ===== */
:root {
  /* Brand Colors */
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-light: #DBEAFE;
  --brand-lighter: #EFF6FF;
  --brand-gradient: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);

  /* Accent */
  --accent: #0EA5E9;
  --accent-light: #E0F2FE;

  /* Semantic */
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #8B5CF6;
  --info-light: #F5F3FF;

  /* Neutrals — Slate */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Surfaces — Glassmorphism (matching vehicle-doc-app style) */
  --bg-body: #EEF2F8;
  --bg-card: rgba(255, 255, 255, 0.58);
  --bg-sidebar: rgba(255, 255, 255, 0.58);
  --bg-sidebar-hover: rgba(255, 255, 255, 0.55);
  --bg-sidebar-active: #FFFFFF;
  --bg-input: rgba(255, 255, 255, 0.65);
  --bg-header: rgba(255, 255, 255, 0.58);

  /* Text */
  --text-primary: #1C1C1E;
  --text-secondary: #3A3A3C;
  --text-muted: #6E6E73;
  --text-inverse: #F8FAFC;
  --text-sidebar: #1C1C1E;
  --text-sidebar-active: #007aff;

  /* Borders */
  --border: rgba(255, 255, 255, 0.85);
  --border-light: #F1F5F9;
  --border-input: #CBD5E1;
  --border-focus: #4f86ff;

  /* Shadows — frosted glass elevation */
  --shadow-xs: 0 1px 2px rgba(30, 41, 59, 0.04);
  --shadow-sm: 0 2px 6px rgba(30, 41, 59, 0.05);
  --shadow-md: 0 6px 16px rgba(30, 41, 59, 0.06);
  --shadow-lg: 0 10px 30px rgba(30, 41, 59, 0.08);
  --shadow-xl: 0 20px 40px rgba(30, 41, 59, 0.10);
  --shadow-focus: 0 0 0 3px rgba(79, 134, 255, 0.15);
  --shadow-card: 0 10px 30px rgba(30, 41, 59, 0.06);

  /* Radii — Glassmorphism matching vehicle-doc-app */
  --radius-sm: 10px;
  --radius: 22px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", "Courier New", monospace;

  /* Z-Index Layers (统一分层，避免 9999 滥用) */
  --z-fab: 600;
  --z-tooltip: 700;
  --z-sidebar: 800;
  --z-dropdown: 900;
  --z-modal: 1000;
  --z-toast: 1100;
}

body {
  font-family: var(--font);
  background: transparent;
  color: var(--text-primary);
  width: 100%;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Round5 Fix T3: 与 vehicle-doc-app 一致的渐变背景 + 光斑动画 ===== */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(155deg, #dbe6ff 0%, #ede4ff 34%, #ffe6ee 62%, #dcf4ec 100%);
}
.app-blob {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.app-blob.b1 {
  width: 560px; height: 560px;
  background: #8ec2ff;
  top: -180px; left: -140px;
  animation: blob-float 16s ease-in-out infinite alternate;
}
.app-blob.b2 {
  width: 480px; height: 480px;
  background: #f2b8d6;
  bottom: -200px; right: -120px;
  animation: blob-float 19s ease-in-out infinite alternate-reverse;
}
.app-blob.b3 {
  width: 380px; height: 380px;
  background: #b8f0d8;
  top: 40%; left: 56%;
  opacity: 0.35;
  animation: blob-float 22s ease-in-out infinite alternate;
}
@keyframes blob-float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .app-blob { animation: none; }
}

/* ===== Auth Pages ===== */
.auth-body {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E293B 0%, #334155 50%, #1E3A5F 100%);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
/* 登录/注册页内容超高时可滚动（修复全局 overflow:hidden 导致底部内容看不到）
   flex 容器默认 min-height:auto 会把子项压到视口高度，导致溢出不可见；
   用 margin:auto 代替 align-items:center，内容超高时自动滚出视口 */
.auth-body .auth-container {
  margin: auto;
  flex-shrink: 0;
}

.auth-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(14, 165, 233, 0.08) 0%, transparent 50%);
}

.auth-container {
  width: 420px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-form { }

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.auth-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.auth-footer a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--slate-700);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 13px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.65);
  transition: all 0.2s;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.18);
  background: #FFFFFF;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.validation-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  height: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.detail-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-item {
  flex: 1;
}

.detail-item label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.detail-item span {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== Buttons — Matching vehicle-doc-app style ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(180deg, #1a84ff, #007aff);
  color: #FFFFFF;
  min-width: 80px;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.32);
  border: none;
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.42);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-success {
  background: var(--success);
  color: #FFFFFF;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-default {
  background: #FFFFFF;
  color: var(--slate-700);
  border: 1px solid var(--border);
}

.btn-default:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-lighter);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.search-btn {
  height: 36px !important;
  padding: 0 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px !important;
  border-radius: var(--radius-sm);
}

.auth-form .btn-primary {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

.modal-footer .btn-primary {
  width: auto;
  padding: 8px 24px;
  flex: 1;
  max-width: 140px;
}

.modal-footer .btn-default {
  width: auto;
  padding: 8px 24px;
  flex: 1;
  max-width: 140px;
}

/* Password strength */
.password-strength {
  margin-top: 8px;
  display: flex;
  gap: 4px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--slate-200);
  border-radius: 2px;
  transition: background 0.3s;
}

.password-strength-bar.weak { background: var(--danger); }
.password-strength-bar.medium { background: var(--warning); }
.password-strength-bar.strong { background: var(--success); }

.password-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.password-hint div {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.password-hint .valid { color: var(--success); }
.password-hint .invalid { color: var(--danger); }

.invite-info {
  margin-top: 8px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
}

.invite-info.valid {
  display: block;
  background: var(--success-light);
  color: #047857;
  border: 1px solid #A7F3D0;
}

.invite-info.invalid {
  display: block;
  background: var(--danger-light);
  color: #B91C1C;
  border: 1px solid #FECACA;
}