/* ========================================================
   Login & 2-Factor Authentication (OTP) - Enterprise Spec
   UI/UX 공통 지침서: Pretendard, 4px/8px 라운드, #2563EB 토큰, 그림자 최소화
   ======================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-page, #F5F6F8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border, #E2E5EA);
  border-radius: var(--radius-card, 8px);
  padding: 32px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary, #2563EB);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-card, 8px);
  background: var(--status-info-bg, #DBEAFE);
  color: var(--primary, #2563EB);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary, #1F2937);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #6B7280);
}

/* 폼 그룹 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #1F2937);
  margin-bottom: 6px;
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-secondary, #6B7280);
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-input {
  width: 100%;
  height: 36px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border, #E2E5EA);
  border-radius: var(--radius-ctrl, 4px);
  padding: 0 12px 0 38px;
  color: var(--text-primary, #1F2937);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--primary, #2563EB);
}

.btn-login {
  width: 100%;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-ctrl, 4px);
  border: none;
  background: var(--primary, #2563EB);
  color: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover {
  background: var(--primary-hover, #1D4ED8);
}

/* 2단계 OTP */
.otp-container {
  display: none;
  animation: fadeIn 0.2s ease;
}

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0 16px;
}

.otp-box {
  width: 44px;
  height: 50px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border, #E2E5EA);
  border-radius: var(--radius-ctrl, 4px);
  color: var(--text-primary, #1F2937);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.otp-box:focus {
  border-color: var(--primary, #2563EB);
}

.otp-timer-bar {
  width: 100%;
  height: 3px;
  background: var(--border, #E2E5EA);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.otp-timer-progress {
  height: 100%;
  background: var(--status-success, #16A34A);
  width: 100%;
  transition: width 1s linear;
}

.otp-guide {
  font-size: 12.5px;
  color: var(--text-secondary, #6B7280);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 16px;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.otp-back-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #6B7280);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.otp-back-btn:hover {
  color: var(--text-primary, #1F2937);
}

.otp-setup-btn {
  background: none;
  border: none;
  color: var(--primary, #2563EB);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.login-error-msg {
  display: none;
  background: var(--status-danger-bg, #FEE2E2);
  border: 1px solid var(--status-danger, #DC2626);
  color: var(--status-danger, #DC2626);
  padding: 8px 12px;
  border-radius: var(--radius-ctrl, 4px);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content {
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border, #E2E5EA);
  border-radius: var(--radius-card, 8px);
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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


/* 모바일 및 다양한 화면비율 대응 보강 */
.login-overlay {
  min-height: 100vh;
  min-width: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

.login-card {
  box-sizing: border-box;
  margin: auto;
}

@media (max-width: 480px) {
  .login-overlay {
    padding: 12px;
  }
  .login-card {
    padding: 24px 18px;
  }
  .login-title {
    font-size: 18px;
  }
  .otp-inputs {
    gap: 4px;
  }
  .otp-box {
    width: 36px;
    height: 42px;
    font-size: 18px;
  }
}
