/* ===================================
   现代化 Odoo 登录页面样式
   基于 new.php 设计
   =================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: #f1f5f9;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* 背景几何图形容器 */
.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.bg-shape {
  position: absolute;
}

/* 左上角 - 蓝色三角 */
.bg-shape-1 {
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 300px solid #0ea5e9;
  border-bottom: 250px solid transparent;
}

/* 右上角 - 橙色形状 */
.bg-shape-2 {
  top: 0;
  right: 0;
  width: 400px;
  height: 300px;
  background: #f97316;
  clip-path: polygon(30% 0%, 100% 0%, 100% 70%, 70% 100%);
}

/* 右下角 - 深蓝形状 */
.bg-shape-3 {
  bottom: 0;
  right: 0;
  width: 500px;
  height: 400px;
  background: #1e293b;
  clip-path: polygon(0% 40%, 100% 0%, 100% 100%, 20% 100%);
}

/* 左下角 - 浅蓝圆形 */
.bg-shape-4 {
  bottom: -100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: #7dd3fc;
  border-radius: 50%;
}

/* 主容器 */
.custom-login-form {
  width: 100%;
  max-width: 1000px;
  height: 80vh;
  max-height: 600px;
  background: white;
  border-radius: 20px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
}

/* 左侧登录区域 */
.login-container {
  flex: 1;
  padding: 60px 0 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  position: relative;
}

.login-box {
  max-width: 380px;
  width: 100%;
}

/* Logo 区域 */
.login-container::before {
  /* content: "";
    position: absolute;
    top: 40px;
    left: 50px;
    width: 120px;
    height: 60px;
    background-image: url("/web/static/img/login-logo.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center; */
}

.login-logo {
  width: 120px;
  height: 60px;
}

.login-title {
  font-size: 32px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 30px;
  line-height: 1.2;
}

/* 表单组 */
.input-group {
  margin-bottom: 28px;
  position: relative;
}

.input-group label,
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.input-group input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 15px;
  color: #1f2937;
  background: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  position: relative;
}

.input-group input:hover {
  border-color: #d1d5db;
}

.input-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.input-group input::placeholder {
  color: #9ca3af;
  transition: color 0.2s ease;
}

.input-group input:focus::placeholder {
  color: #d1d5db;
}

/* 输入框聚焦时的标签动画 */
.input-group input:focus + label,
.input-group:focus-within label {
  color: #3b82f6;
}

/* 登录按钮 */
.login-btn {
  width: 100%;
  height: 50px;
  background: #1f2937;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 32px;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.login-btn:hover {
  background: #111827;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-btn:active {
  background: #0f172a;
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 涟漪效果 */
.login-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.login-btn:active::before {
  width: 300px;
  height: 300px;
}

/* 错误和成功提示 */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert.error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* 右侧设计区域 */
.design-section {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 轮播背景切换 */
.design-section.slide-0 {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

.design-section.slide-1 {
  background: linear-gradient(135deg, #059669 0%, #047857 50%, #1e40af 100%);
}

.design-section.slide-2 {
  background: linear-gradient(135deg, #f59e0b 0%, #dc2626 50%, #1f2937 100%);
}

/* 右侧几何装饰背景容器 */
.right-geometric-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.right-shape {
  position: absolute;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 隐藏所有几何集合 */
.geometric-set {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.geometric-set.active {
  opacity: 1;
}

/* === 第一个轮播样式 (蓝色主题) === */
.geometric-set-0 .right-shape-1 {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

/* 左上角白色点阵 */
.geometric-set-0 .dots-white-1 {
  top: 30px;
  left: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.dot-white {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

/* 右上角粉色圆 */
.geometric-set-0 .right-shape-2 {
  top: -50px;
  right: -30px;
  width: 150px;
  height: 150px;
  background: #ec4899;
  border-radius: 50%;
  animation: float 3s ease-in-out infinite;
}

/* 左侧粉色矩形 */
.geometric-set-0 .right-shape-3 {
  top: 120px;
  left: 0;
  width: 120px;
  height: 80px;
  background: #f472b6;
  animation: geometricFloat 4s ease-in-out infinite;
}

/* 右下角橙色点阵 */
.geometric-set-0 .dots-orange-1 {
  bottom: 80px;
  right: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.dot-orange {
  width: 6px;
  height: 6px;
  background: #f97316;
  border-radius: 50%;
}

/* === 第二个轮播样式 (绿色主题) === */
.geometric-set-1 .right-shape-1 {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #059669 0%, #047857 50%, #1e40af 100%);
}

.geometric-set-1 .dots-white-1 {
  top: 40px;
  left: 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.geometric-set-1 .right-shape-2 {
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: #10b981;
  border-radius: 50%;
  animation: float 3s ease-in-out infinite;
}

.geometric-set-1 .right-shape-3 {
  top: 110px;
  left: -10px;
  width: 130px;
  height: 70px;
  background: #34d399;
  animation: geometricFloat 4s ease-in-out infinite;
}

.geometric-set-1 .dots-green-1 {
  bottom: 90px;
  right: 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.dot-green {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

/* === 第三个轮播样式 (橙色主题) === */
.geometric-set-2 .right-shape-1 {
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: #fbbf24;
}

.geometric-set-2 .right-shape-2 {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: #1f2937;
}

/* 左上角深蓝色几何 */
.geometric-set-2 .right-shape-3 {
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-right: 80px solid #1f2937;
  border-bottom: 60px solid transparent;
}

/* 橙色大圆 */
.geometric-set-2 .right-shape-4 {
  top: -80px;
  left: 50px;
  width: 200px;
  height: 200px;
  background: #f97316;
  border-radius: 50%;
  animation: float 3s ease-in-out infinite;
}

/* 右侧橙色点阵 */
.geometric-set-2 .dots-orange-2 {
  top: 100px;
  right: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* 几何动画 */
@keyframes dotsPulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes geometricFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* 持续动画效果 */
.right-shape {
  animation: geometricFloat 4s ease-in-out infinite;
}

.right-shape:nth-child(even) {
  animation-delay: 0.5s;
  animation-direction: reverse;
}

.dots-white-1,
.dots-orange-1,
.dots-green-1,
.dots-orange-2 {
  animation: dotsPulse 3s ease-in-out infinite;
}

.dots-orange-1,
.dots-green-1 {
  animation-delay: 1s;
}

.dots-orange-2 {
  animation-delay: 2s;
}

/* 笔记本电脑 mockup */
.laptop-mockup {
  position: absolute;
  top: 20%;
  /* left: 50%; */
  transform: translateX(-50%);
  width: 320px;
  height: 200px;
  z-index: 100;
  animation: float 3s ease-in-out infinite;
}

.laptop-screen {
  width: 100%;
  height: 85%;
  background: white;
  border-radius: 8px 8px 0 0;
  padding: 12px;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.mockup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  height: 20px;
}

.mockup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mockup-dot.red {
  background: #ef4444;
}

.mockup-dot.yellow {
  background: #eab308;
}

.mockup-dot.green {
  background: #22c55e;
}

.mockup-title {
  font-size: 9px;
  font-weight: 600;
  color: #374151;
  margin-left: auto;
}

.mockup-content {
  width: 100%;
  height: calc(100% - 30px);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #64748b;
}

.laptop-base {
  height: 15%;
  background: #e2e8f0;
  border-radius: 0 0 4px 4px;
  position: relative;
}

.laptop-base::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px 2px 0 0;
}

/* 底部内容区域 */
.bottom-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  padding: 30px;
  z-index: 50;
}

.carousel-slide {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 100%;
  padding: 0 60px;
  max-width: 500px;
}

.carousel-slide.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.bottom-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
  color: white;
}

.bottom-description {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-bottom: 40px;
}

/* 轮播指示器 */
.carousel-indicators {
  display: flex;
  gap: 8px;
  position: absolute;
  margin-left: 0 !important;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.indicator.active {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.4);
}

/* 动画效果 */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 登录框淡入动画 */
.login-box {
  animation: fadeIn 0.6s ease-out;
}

/* 输入框获得焦点时的动画 */
@keyframes inputFocus {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.2);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.05);
  }
}

.input-group input:focus {
  animation: inputFocus 0.3s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-y: auto;
  }

  /* 移动端隐藏背景几何图形 */
  .background-shapes {
    display: none;
  }

  .custom-login-form {
    width: 100%;
    height: auto;
    min-height: 100vh;
    border-radius: 0;
    flex-direction: column;
    background: transparent;
    box-shadow: none;
  }

  /* 隐藏右侧设计区域 */
  .design-section {
    display: none !important;
  }

  .login-container {
    padding: 60px 32px 40px 32px;
    background: white;
    margin: 20px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 20px auto;
    width: calc(100% - 40px);
  }

  .login-container::before {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  .login-box {
    max-width: 100%;
  }

  .login-title {
    font-size: 28px;
    margin-bottom: 40px;
    text-align: center;
  }

  .input-group {
    margin-bottom: 24px;
  }

  .input-group input,
  .database-selector select {
    height: 52px;
    font-size: 16px;
    padding: 0 18px;
  }

  .login-btn {
    height: 52px;
    font-size: 16px;
    margin-top: 24px;
  }

  .forgot-password {
    font-size: 14px;
    margin-top: 16px;
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .login-container {
    margin: 10px;
    padding: 40px 24px 30px 24px;
    width: calc(100% - 20px);
  }

  .login-title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .input-group input {
    height: 48px;
    font-size: 15px;
  }

  .login-btn {
    height: 48px;
    font-size: 15px;
  }
}

/* 加载状态 */
.login-btn.loading {
  background: #374151;
  cursor: wait;
  transform: none;
  pointer-events: none;
}

.login-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 忘记密码链接样式 */
.forgot-password {
  text-align: center;
  font-size: 14px;
  color: #9ca3af;
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.forgot-password a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.forgot-password a:hover {
  text-decoration: underline;
  color: #1e40af;
}

/* 数据库选择器样式 */
.database-selector {
  margin-bottom: 28px;
}

.database-selector select {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 15px;
  color: #1f2937;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
  font-family: inherit;
}

.database-selector select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.05);
}

/* 平滑滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 表单错误状态 */
.has-error input {
  border-color: #ef4444;
  background: #fef2f2;
}

.has-error label {
  color: #ef4444;
}

.error-message {
  color: #ef4444;
  font-size: 13px;
  margin-top: 6px;
}

/* 焦点可见性改进 */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* 打印样式 */
@media print {
  .background-shapes {
    display: none;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  /* 如果需要深色模式，可以在这里添加样式 */
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .input-group input,
  .login-btn {
    border: 2px solid currentColor;
  }
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 15px;
  color: #1f2937;
  background: white;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.05);
}

.form-input::placeholder {
  color: #9ca3af;
}
