/* ================================ */
/* 現代化商城登入系統樣式 v2.0      */
/* 架構: BEM + CSS變數 + 移動優先    */
/* 兼容: Modern Browsers + IE11+    */
/* ================================ */

:root {
  /* 設計系統變數 */
  --primary-color: #006DD9;
  --secondary-color: #FF7F00;
  --text-dark: #333;
  --text-muted: #666;
  --border-color: #E7E7E7;
  --bg-light: #F9F9F9;
  --transition-base: 0.2s ease-in-out;
  
  /* 響應式斷點 */
  --breakpoint-mobile: 500px;
  --breakpoint-tablet: 850px;
}

/* ========= 基礎重置 ========= */
.nc-login *,
.nc-login *::before,
.nc-login *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========= 通用組件 ========= */
.nc-login {
  /* 佈局系統 */
  &-layout {
    width: 100%;
    margin: 0 auto;
    background: var(--bg-light);
    
    @media (min-width: var(--breakpoint-mobile)) {
      width: 300px;
    }
    
    @media (min-width: var(--breakpoint-tablet)) {
      width: 850px;
    }
  }

  /* 表單容器 */
  &-container {
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-top: none;
  }
}

/* ========= 標題區域 ========= */
.nc-login__header {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  padding: 1.5rem;

  &-title {
    font: 300 1.25rem/1.2 "微軟雅黑", sans-serif;
    color: var(--text-dark);
  }
}

/* ========= 表單元素 ========= */
.login-form {
  --input-height: 2.5rem;
  
  &__group {
    margin-bottom: 1.5rem;
    position: relative;
  }

  &__label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
  }

  &__input {
    width: 100%;
    height: var(--input-height);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color var(--transition-base);

    &:focus {
      border-color: var(--secondary-color);
      outline: 2px solid rgba(255, 220, 151, 0.5);
    }
  }
}

/* ========= 按鈕系統 ========= */
.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: 
    filter var(--transition-base),
    transform var(--transition-base);

  &--primary {
    background: var(--primary-color);
    color: white;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
    
    &:hover {
      filter: brightness(1.1);
    }
  }

  &--secondary {
    background: var(--secondary-color);
    color: white;
    
    &:hover {
      transform: translateY(-1px);
    }
  }

  &--social {
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    
    .icon {
      width: 1.25rem;
      height: 1.25rem;
    }
  }
}

/* ========= 第三方登入 ========= */
.social-auth {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px dashed var(--border-color);

  @media (min-width: 480px) {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========= 響應式佈局 ========= */
@media (min-width: var(--breakpoint-tablet)) {
  .nc-login-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 2rem;
  }

  .left-panel {
    position: relative;
    overflow: hidden;
    border-radius: 8px;

    &__image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    &__content {
      position: absolute;
      bottom: 2rem;
      left: 2rem;
      color: white;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
  }
}

/* ========= 動畫效果 ========= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.nc-login-container {
  animation: fadeIn 0.3s ease-out;
}

/* ========= 工具類 ========= */
.hidden-mobile {
  @media (max-width: var(--breakpoint-tablet)) {
    display: none !important;
  }
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 0.5rem;
}

/* ========= 可訪問性優化 ========= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}