/**
 * Path: Public/assets/css/login.css
 * 說明: 柔和綠灰風格登入頁（手機優先）
 * 定版重點:
 * - login/OTP 共用同一套殼（login-body/login-shell/login-wrapper）
 * - login-message 基底永遠置中；success/info/error 三態一致
 * - 補齊 btn-link（OTP 重新寄送會用到）
 * - login-body 同時水平+垂直置中（避免頁面看起來沒置中）
 */

.login-body {
  min-height: 100vh;
  background: #f3f4f6; /* 柔霧灰 */
  display: flex;
  justify-content: center;
  align-items: center;          /* ✅ 垂直置中 */
  padding: 16px 0;              /* ✅ 避免極小螢幕貼邊 */
}

.login-shell {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
}

/* ---------- LOGO 區 ---------- */
.login-brand {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;          /* 柔和的方角，而不是圓形 */
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 17px;
  font-weight: 600;
  color: #374151; /* 柔黑 */
}

.brand-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7280; /* 柔灰 */
}

/* ---------- 卡片 ---------- */
.login-wrapper {
  width: 100%;
  margin: 16px auto 12px;
  padding: 20px 20px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.login-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

/* ---------- 表單 ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 15px;
}

.form-label {
  font-size: 13px;
  color: #4b5563;
}

.form-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 14px;
}

.form-group input:focus {
  border-color: #4ca771;
  box-shadow: 0 0 0 1px rgba(76, 167, 113, 0.25);
  outline: none;
}

/* ---------- 按鈕 ---------- */
.btn-primary {
  background: #4ca771 !important;    /* 柔和綠 */
  color: white;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  transition: 0.15s ease;
  cursor: pointer;
}

.btn-primary:hover {
  background: #429565 !important;
}

.btn-primary:active {
  background: #397f56 !important;
}

.btn-block {
  width: 100%;
}

/* ✅ 補齊 btn-link（OTP 重新寄送 / 其他弱動作用） */
.btn-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  color: #4ca771;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  color: #429565;
}

/* ---------- 其他 ---------- */
.login-extra {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.login-extra a {
  color: #4ca771;
  font-weight: 600;
  text-decoration: none;
}

.login-extra a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-footer {
  margin-top: auto;
  padding-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

/* ---------- 訊息（共用） ---------- */
/* ✅ 訊息基底：不論 success / info / error 都先置中 */
.login-message {
  text-align: center;
  padding: 10px 12px;
  margin-top: 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

/* ✅ error/info/success 三態 */
.login-message.error {
  color: #b91c1c;
  background: rgba(255, 0, 0, 0.08);
}

.login-message.info {
  color: #b91c1c;
  background: rgba(255, 0, 0, 0.08);
}

.login-message.success {
  color: #15803d;
  background: rgba(21, 128, 61, 0.08);
}

/* ---------- 下拉選單樣式（申請/登入表單） ---------- */
.login-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  color: #111827;
  outline: none;
}

/* focus 時的邊框與陰影（跟 input 同一風格，維持綠色系一致） */
.login-form select:focus {
  border-color: #4ca771;
  box-shadow: 0 0 0 1px rgba(76, 167, 113, 0.25);
  background-color: #ffffff;
}

/* ---------- 桌機優化 ---------- */
@media (min-width: 768px) {
  .login-shell {
    padding-top: 30px; /* ✅ 因為 body 已垂直置中，不需要再推很下面 */
  }
}
